Skip to content

pull request build result comment #1

pull request build result comment

pull request build result comment #1

name: pull request build result comment
on:
workflow_run:
workflows: [build]
types: [completed]
jobs:
success:
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- id: getUrls
name: get URLs
uses: actions/github-script@v7
with:
script: |
const result = {};
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
for (const artifact of artifacts) {
if (artifact.name.startsWith("osara_windows")) {
result.windows = artifact.archive_download_url;
} else if (artifact.name.startsWith("osara_mac")) {
result.mac = artifact.archive_download_url;
}
}
return result;
- name: comment
uses: thollander/actions-comment-pull-request@v3
with:
message: |

Check failure on line 33 in .github/workflows/prBuildResultComment.yml

View workflow run for this annotation

GitHub Actions / pull request build result comment

Invalid workflow file

The workflow is not valid. .github/workflows/prBuildResultComment.yml (Line: 33, Col: 20): The expression is not closed. An unescaped ${{ sequence was found, but the closing }} sequence was not found.
[Build succeeded!](https://github.com/jcsteh/osara/actions/runs/${{ github.event.workflow_run.id }})
- [Download for Windows](${{ steps.getUrls.outputs.windows)
- [Download for Mac](${{ steps.getUrls.outputs.mac)
failure:
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- name: comment
uses: thollander/actions-comment-pull-request@v3
with:
message: |
[Build failed!](https://github.com/jcsteh/osara/actions/runs/${{ github.event.workflow_run.id }})