Skip to content

Commit

Permalink
simplified action that produces conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorelli25 committed May 22, 2024
1 parent d67154a commit b6e9019
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/delete-serverless-dir-on-backports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Delete serverless directory on backports

on:
pull_request:
branches-ignore:
- 'main'

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 --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 }}

0 comments on commit b6e9019

Please sign in to comment.