-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…4015) * Delete serverless directory on backport PRs (#3916) * simplified action that produces conflicts * Update delete-serverless-dir-on-backports.yml * Update .github/workflows/delete-serverless-dir-on-backports.yml * Update .github/workflows/delete-serverless-dir-on-backports.yml * add to readme (cherry picked from commit 4a57e39) # Conflicts: # README.md * Update README.md --------- Co-authored-by: Brandon Morelli <[email protected]>
- Loading branch information
1 parent
00760cc
commit 8e84312
Showing
2 changed files
with
88 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Delete serverless directory in backports | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '7.*' | ||
- '8.*' | ||
|
||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters