mirror of
https://github.com/peter-evans/create-or-update-comment.git
synced 2025-04-09 02:40:12 +08:00
Add test command workflow
This commit is contained in:
parent
9f320992d5
commit
a3cfeddd99
16
.github/workflows/slash-command-dispatch.yml
vendored
Normal file
16
.github/workflows/slash-command-dispatch.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
name: Slash Command Dispatch
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
jobs:
|
||||||
|
slashCommandDispatch:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Slash Command Dispatch
|
||||||
|
uses: peter-evans/slash-command-dispatch@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.REPO_ACCESS_TOKEN }}
|
||||||
|
reaction-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
commands: test
|
||||||
|
permission: admin
|
||||||
|
named-args: true
|
60
.github/workflows/test-command.yml
vendored
Normal file
60
.github/workflows/test-command.yml
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
name: Test Command
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: [test-command]
|
||||||
|
jobs:
|
||||||
|
testCreateOrUpdateComment:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Get the target repository and branch
|
||||||
|
- name: Get the target repository and branch
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
repository=${{ github.event.client_payload.slash_command.repository }}
|
||||||
|
if [[ -z "$repository" ]]; then repository=${{ github.repository }}; fi
|
||||||
|
echo ::set-output name=repository::$repository
|
||||||
|
branch=${{ github.event.client_payload.slash_command.branch }}
|
||||||
|
if [[ -z "$branch" ]]; then branch="master"; fi
|
||||||
|
echo ::set-output name=branch::$branch
|
||||||
|
|
||||||
|
# Checkout the branch to test
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
repository: ${{ steps.vars.outputs.repository }}
|
||||||
|
ref: ${{ steps.vars.outputs.branch }}
|
||||||
|
|
||||||
|
# Test create
|
||||||
|
- name: Create comment
|
||||||
|
uses: ./
|
||||||
|
id: couc
|
||||||
|
with:
|
||||||
|
issue-number: 1
|
||||||
|
body: |
|
||||||
|
This is a multi-line test comment
|
||||||
|
- With GitHub **Markdown**
|
||||||
|
- Created by [create-or-update-comment][1]
|
||||||
|
|
||||||
|
[1]: https://github.com/peter-evans/create-or-update-comment
|
||||||
|
reaction-type: '+1'
|
||||||
|
|
||||||
|
# Test update
|
||||||
|
- name: Update comment
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
comment-id: ${{ steps.couc.outputs.comment-id }}
|
||||||
|
body: |
|
||||||
|
**Edit:** Some additional info
|
||||||
|
reaction-type: eyes
|
||||||
|
|
||||||
|
- name: Add reaction
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
comment-id: ${{ steps.couc.outputs.comment-id }}
|
||||||
|
reaction-type: heart
|
||||||
|
|
||||||
|
- name: Add reaction
|
||||||
|
uses: peter-evans/create-or-update-comment@v1
|
||||||
|
with:
|
||||||
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
|
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
||||||
|
reaction-type: hooray
|
Loading…
x
Reference in New Issue
Block a user