We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 852b47c commit 6266df7Copy full SHA for 6266df7
1 file changed
.github/workflows/comment-trigger.yml
@@ -0,0 +1,28 @@
1
+name: Comment Trigger
2
+
3
+on:
4
+ issue_comment:
5
+ types: [created]
6
7
+permissions:
8
+ actions: write
9
+ pull-requests: read
10
11
+jobs:
12
+ trigger-test:
13
+ if: github.event.issue.pull_request != null && github.event.comment.body == '/test'
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Get PR branch
17
+ id: pr
18
+ env:
19
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20
+ run: |
21
+ BRANCH=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json headRefName --jq '.headRefName')
22
+ echo "branch=$BRANCH" >> $GITHUB_OUTPUT
23
24
+ - name: Trigger test workflow
25
26
27
28
+ gh workflow run test.yml --ref "${{ steps.pr.outputs.branch }}"
0 commit comments