Skip to content

Commit 764a4fa

Browse files
committed
feat: add /update-snapshot comment trigger to update_snapshot workflow
1 parent 53877bb commit 764a4fa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/update_snapshot.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- 'dependabot/**'
7+
- 'dependabot/**'
8+
issue_comment:
9+
types: [created]
810

911
permissions:
1012
contents: write
1113
jobs:
1214
update:
15+
if: >
16+
github.event_name == 'push' ||
17+
github.event_name == 'workflow_dispatch' ||
18+
(github.event.issue.pull_request && contains(github.event.comment.body, '/update-snapshot'))
1319
runs-on: ubuntu-latest
1420
steps:
1521
- uses: actions/checkout@v5
22+
with:
23+
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}
1624
- name: Use Node.js
1725
uses: actions/setup-node@v6
1826
with:

0 commit comments

Comments
 (0)