-
-
Save watura/1dac5230b256331a1fb00eb9d612ac29 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
json=$(gh pr list -B master --search "review:approved" --json number) | |
for number in $(echo "$json" | jq -r '.[].number'); do | |
gh api \ | |
--method PUT \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/ORG/REPO/pulls/$number/update-branch | |
done |
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
name: Keep update branches | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
update_version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Branches | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: sh keep_update.sh |
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
name: Keep update branches(Review Approved) | |
on: | |
pull_request_review: | |
types: [submitted] | |
jobs: | |
update_version: | |
if: github.event.review.state == 'approved' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Branches | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: sh keep_update.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment