generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed checkout of branch after merge in e2e Signed-off-by: kouki <[email protected]>
- Loading branch information
Showing
4 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: handle PR comments | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
actions: write | ||
|
||
jobs: | ||
trigger_e2e: | ||
name: "Trigger e2e test" | ||
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/test') && contains('["OWNER", "COLLABORATOR", "CONTRIBUTOR"]', github.event.comment.author_association) | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: create reaction | ||
env: | ||
GH_TOKEN: ${{ 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 | ||
- name: trigger e2e | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
BRANCH_NAME=$(gh pr view --json headRefName --jq .headRefName ${{ github.event.issue.number }}) | ||
echo "triggering e2e" | ||
gh workflow run --ref ${BRANCH_NAME} ci-e2e.yaml |