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 13, 2024
1 parent 7493cc2 commit d6da11a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/add-label-when-promoted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ jobs:
ref: ${{ env.DEFAULT_BRANCH }}
token: ${{ secrets.AUTO_BACKPORT_TOKEN }}
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Set up Git identity
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
if: github.event_name == 'push'
env:
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 whe promotion completed
if: github.event_name == 'push'
- name: Run auto-backport.py when promotion completed
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 d6da11a

Please sign in to comment.