File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,20 +2,27 @@ name: Sync Lockfile
22
33on :
44 pull_request :
5- paths : ['package.json']
5+ paths : ["package.json"]
6+ push :
7+ branches : [main, master]
8+ paths : ["package.json"]
69
710permissions :
811 contents : write
912
1013jobs :
1114 sync :
12- if : github.event.pull_request.user.login == 'dependabot[bot]' && github.event.pull_request.state == 'open'
15+ if : >
16+ github.event_name == 'push' ||
17+ (github.event_name == 'pull_request' &&
18+ github.event.pull_request.user.login == 'dependabot[bot]' &&
19+ github.event.pull_request.state == 'open')
1320 runs-on : ubuntu-latest
1421 timeout-minutes : 10
1522 steps :
1623 - uses : actions/checkout@v6
1724 with :
18- ref : ${{ github.head_ref }}
25+ ref : ${{ github.event_name == 'push' && github.ref || github. head_ref }}
1926 token : ${{ secrets.GITHUB_TOKEN }}
2027
2128 - uses : oven-sh/setup-bun@v2
3239 exit 0
3340 fi
3441 git commit -m "chore: sync bun.lock"
35- git pull --rebase origin ${{ github.head_ref }}
42+ git pull --rebase origin ${{ github.event_name == 'push' && github.ref_name || github. head_ref }}
3643 git push
You can’t perform that action at this time.
0 commit comments