An action to add or update an existing comment anchored in a PR for test results, status messages, etc.
| .github | ||
| action.yml | ||
| COPYING | ||
| LICENSE | ||
action-pr-comment
An action to add or update an existing comment anchored in a PR for test results, status messages, etc.
Example
name: Some Workflow
on:
pull_request:
jobs:
some-workflow:
name: Send PR Comment
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') }}
runs-on: ubuntu-act-latest
steps:
- name: Validate
id: validate
shell: bash
run: |
some-validation-step arg1 arg2 ... 2>&1 | tee validate.json
export SOME_ENV_VAR=$(cat validate.json | sed -z 's/\n/\\n/g')
echo "SOME_ENV_VAR=\"$SOME_ENV_VAR\"" >> $GITHUB_OUTPUT
- name: Post/Update PR Comment
if: always()
uses: https://git.auengun.net/homelab/action-pr-comment@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment: |
#### Validation 🤖 \`${{ steps.validate.outcome }}\`
<details open>
<summary>Shell Output</summary>
\`\`\`json\n
${{ fromJSON(steps.validate.outputs.SOME_ENV_VAR) }}
\`\`\`
</details>
*Commit: ${{ github.sha }}*