Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete serverless directory on backport PRs #3916

Merged
merged 6 commits into from
Jun 17, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/delete-serverless-dir-on-backports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Delete serverless directory in backports

on:
pull_request:
branches:
- '7.*'
- '8.*'
branches-ignore:
- 'main'
bmorelli25 marked this conversation as resolved.
Show resolved Hide resolved

jobs:
check-and-delete-serverless:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for existence of docs/en/serverless directory
id: check_serverless
run: |
if [ -d "docs/en/serverless" ]; then
echo "SERVERLESS_EXISTS=true" >> $GITHUB_ENV
else
echo "SERVERLESS_EXISTS=false" >> $GITHUB_ENV
fi

- name: Delete docs/en/serverless directory if it exists
if: env.SERVERLESS_EXISTS == 'true'
run: |
rm -rf docs/en/serverless
git config pull.rebase true
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Delete docs/en/serverless directory"
git pull origin ${{ github.head_ref }}
git push origin HEAD:${{ github.head_ref }}