Skip to content

hello-workflow-command #15

hello-workflow-command

hello-workflow-command #15

name: hello-workflow-command
on:
workflow_dispatch:
inputs:
repository:
description: 'The repository from which the slash command was dispatched'
required: true
comment-id:
description: 'The comment-id of the slash command'
required: true
issue-number:
description: 'The issue number in which the slash command was made'
required: true
actor:
description: 'The user who executed the slash command'
required: true
jobs:
helloWorld:
runs-on: ubuntu-latest
steps:
- name: Add reaction
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
repository: ${{ github.event.inputs.repository }}
comment-id: ${{ github.event.inputs.comment-id }}
reactions: hooray
- name: Create URL to the run output
id: vars
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
repository: ${{ github.event.inputs.repository }}
issue-number: ${{ github.event.inputs.issue-number }}
body: |
Hello @${{ github.event.inputs.actor }}!
[Click here to see the command run output][1]
[1]: ${{ steps.vars.outputs.run-url }}