Skip to content

PR Comment

PR Comment #13086

Workflow file for this run

name: PR Comment
on:
workflow_run:
workflows:
[
"PR Description",
"PR Title",
"Merobox Proposals - Blockchain Integration Tests",
"E2E - Rust Apps",
"E2E - Blockchain Proposals",
]
types:
- completed
jobs:
submit:
name: Submit
runs-on: ubuntu-latest
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion != 'cancelled'
steps:
- name: Set artifact name
id: artifact
run: |
case "${{ github.event.workflow_run.name }}" in
"E2E - Rust Apps") echo "name=pr-comment-payload-rust-apps" >> $GITHUB_OUTPUT ;;
"E2E - Blockchain Proposals") echo "name=pr-comment-payload-blockchain" >> $GITHUB_OUTPUT ;;
*) echo "name=pr-comment-payload" >> $GITHUB_OUTPUT ;;
esac
- name: Download artifact
id: download
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: ${{ steps.artifact.outputs.name }}
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract payload
id: payload
if: ${{ steps.download.outcome == 'success' }}
run: |
cat payload.json
echo "pr=$(jq '.pr' payload.json)" >> $GITHUB_OUTPUT
echo "tag=$(jq '.tag' payload.json)" >> $GITHUB_OUTPUT
echo "mode=$(jq '.mode' payload.json)" >> $GITHUB_OUTPUT
echo "message=$(jq '.message' payload.json)" >> $GITHUB_OUTPUT
- name: Apply pull request comment
if: ${{ steps.download.outcome == 'success' }}
uses: thollander/actions-comment-pull-request@v3
with:
pr-number: ${{ fromJson(steps.payload.outputs.pr) }}
comment-tag: ${{ fromJson(steps.payload.outputs.tag) }}
mode: ${{ fromJson(steps.payload.outputs.mode) }}
message: ${{ fromJson(steps.payload.outputs.message) }}