Skip to content

Commit

Permalink
fix: Fix CI for auto update pull requests (box/box-codegen#506) (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Jun 6, 2024
1 parent 89e34ae commit 5e59f69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "ae78196", "specHash": "c3c012c", "version": "1.0.0" }
{ "engineHash": "3ed6b56", "specHash": "c3c012c", "version": "1.0.0" }
12 changes: 4 additions & 8 deletions .github/workflows/autoupdate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ on:
jobs:
update_pull_requests:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
token: ${{ secrets.DISPATCH_ACCESS_TOKEN }}

- name: Set up Git
run: |
Expand All @@ -25,10 +23,8 @@ jobs:
run: git fetch --prune --unshallow

- name: Auto update pull requests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" | jq -r '.[] | .head.ref')
PR_LIST=$(curl -s -H "Authorization: Bearer ${{ secrets.DISPATCH_ACCESS_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" | jq -r '.[] | .head.ref')
for pr_branch in $PR_LIST; do
git checkout "$pr_branch"
if git merge origin/main; then
Expand Down

0 comments on commit 5e59f69

Please sign in to comment.