Skip to content

hello-world-pr-command #212

hello-world-pr-command

hello-world-pr-command #212

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