test #18
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: pr-comments | |
on: | |
issue_comment: | |
types: | |
- created | |
permissions: | |
contents: read | |
pull-requests: write | |
actions: write | |
jobs: | |
trigger: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/plan') }} | |
steps: | |
- name: Create reaction | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# https://docs.github.com/ja/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-an-issue-comment | |
# needs pull_requests:write permission | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \ | |
-f content='rocket' | |
- uses: actions/checkout@v4 | |
- uses: aquaproj/[email protected] | |
with: | |
aqua_version: v2.21.0 | |
- name: trigger | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
BRANCH_NAME=$(gh pr view --json headRefName --jq .headRefName ${{ github.event.issue.number }}) | |
github-comment exec -- gh workflow run -f pull-request-number=${{ github.event.issue.number }} --ref ${BRANCH_NAME} test.yaml |