hello-world-pr-command #207
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: hello-world-pr-command | |
on: | |
repository_dispatch: | |
types: [hello-world-pr-command] | |
jobs: | |
helloWorld: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the pull request branch | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | |
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.client_payload.pull_request.head.ref }} | |
# Append a response to the user that issued the command | |
- name: Append to hello-world.txt | |
run: echo "Hello @${{ github.event.client_payload.github.actor }}!" >> hello-world.txt | |
# Commit the change to the PR branch | |
- name: Commit to the PR branch | |
run: | | |
git config --global user.name 'actions-bot' | |
git config --global user.email '[email protected]' | |
git add -A | |
git commit -m "[hello-world-pr-command] Add hello response" | |
git push | |
- name: Add reaction | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | |
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | |
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | |
reactions: hooray |