Skip to content

Commit

Permalink
./github/workflows/add-label-when-promoted.yaml: Run auto-backport on…
Browse files Browse the repository at this point in the history
…ly on default branch

In #21496 (comment)
```
scylladbbot force-pushed the backport/21459/to-6.1 branch from 414691c to 59a4ccd Compare 2 days ago
```
Backport automation is triggered by push but should also start from the master branch (or enterprise branches from Enterprise). We need to verify it by checking the default branch.

(cherry picked from commit 26ef84f)
  • Loading branch information
yaronkaikov committed Nov 24, 2024
1 parent 0e60457 commit c6a86da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/add-label-when-promoted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git config --global merge.conflictstyle diff3
- name: Install dependencies
run: sudo apt-get install -y python3-github python3-git
- name: Run python script
Expand All @@ -48,7 +49,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.AUTO_BACKPORT_TOKEN }}
run: python .github/scripts/search_commits.py --commits ${{ github.event.before }}..${{ github.sha }} --repository ${{ github.repository }} --ref ${{ github.ref }}
- name: Run auto-backport.py when promotion completed
if: github.event_name == 'push'
if: github.event_name == 'push' && github.ref == 'refs/heads/${{ env.DEFAULT_BRANCH }}'
env:
GITHUB_TOKEN: ${{ secrets.AUTO_BACKPORT_TOKEN }}
run: python .github/scripts/auto-backport.py --repo ${{ github.repository }} --base-branch ${{ github.ref }} --commits ${{ github.event.before }}..${{ github.sha }}
Expand Down

0 comments on commit c6a86da

Please sign in to comment.