mirror of
https://github.com/peter-evans/create-or-update-comment.git
synced 2025-01-19 03:26:42 +08:00
223779bc56
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
86 lines
2.5 KiB
YAML
86 lines
2.5 KiB
YAML
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 "repository=$repository" >> $GITHUB_OUTPUT
|
|
branch=${{ github.event.client_payload.slash_command.branch }}
|
|
if [[ -z "$branch" ]]; then branch="main"; fi
|
|
echo "branch=$branch" >> $GITHUB_OUTPUT
|
|
|
|
# Checkout the branch to test
|
|
- uses: actions/checkout@v4
|
|
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** :sparkles:
|
|
- Created by [create-or-update-comment][1]
|
|
|
|
[1]: https://github.com/peter-evans/create-or-update-comment
|
|
reactions: '+1'
|
|
|
|
# Test update
|
|
- name: Update comment
|
|
uses: ./
|
|
with:
|
|
comment-id: ${{ steps.couc.outputs.comment-id }}
|
|
body: |
|
|
**Edit:** Some additional info
|
|
reactions: eyes
|
|
reactions-edit-mode: replace
|
|
|
|
# Test add reactions
|
|
- name: Add reactions
|
|
uses: ./
|
|
with:
|
|
comment-id: ${{ steps.couc.outputs.comment-id }}
|
|
reactions: heart, hooray, laugh
|
|
|
|
# Test create with body from file
|
|
- name: Create comment
|
|
uses: ./
|
|
with:
|
|
issue-number: 1
|
|
body-path: .github/comment-body.md
|
|
|
|
# Test create from template
|
|
- name: Render template
|
|
id: template
|
|
uses: chuhlomin/render-template@v1.7
|
|
with:
|
|
template: .github/comment-template.md
|
|
vars: |
|
|
foo: this
|
|
bar: that
|
|
|
|
- name: Create comment
|
|
uses: ./
|
|
with:
|
|
issue-number: 1
|
|
body: ${{ steps.template.outputs.result }}
|
|
|
|
- name: Add reaction
|
|
uses: peter-evans/create-or-update-comment@v3
|
|
with:
|
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
|
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
|
reactions: hooray
|