From 3b1a51b393ce971f94cac2df79e7efcce43893e6 Mon Sep 17 00:00:00 2001 From: blue linden Date: Mon, 16 Feb 2026 20:10:47 -0500 Subject: [PATCH] Comment the GH Actions run link on `!build` comments for easier troubleshooting (#3392) * Comment on `!build` requests with the Actions run ID for easier troubleshooting * Update the triggering comment instead of making another one for the build link * Make sure the workflow doesn't fail if the triggering comment was deleted. * Post comment on build/upload failure * Don't post a build link comment separately if the OG is deleted --------- Co-authored-by: Keavon Chambers --- .github/workflows/comment-!build-commands.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/comment-!build-commands.yml b/.github/workflows/comment-!build-commands.yml index 87b8581b..7389dbe2 100644 --- a/.github/workflows/comment-!build-commands.yml +++ b/.github/workflows/comment-!build-commands.yml @@ -92,12 +92,37 @@ jobs: echo "Failed to detect if the build command written in the comment should have been '!build-dev', '!build-profiling', or '!build'" >> $GITHUB_OUTPUT fi + - name: 💬 Comment Actions run link + id: comment_actions_run_link + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.updateComment({ + comment_id: ${{ github.event.comment.id }}, + owner: context.repo.owner, + repo: context.repo.repo, + body: '!build ([build link](https://github.com/GraphiteEditor/Graphite/actions/runs/' + context.runId + '))' + }); + - name: 🌐 Build Graphite web code env: NODE_ENV: production + if: ${{ success() || failure()}} run: | cd frontend mold -run npm run ${{ steps.build_command.outputs.command }} + + - name: ❗ Warn on build failure + if: ${{ failure() }} + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'The build process has failed. Please check the [build logs](https://github.com/GraphiteEditor/Graphite/actions/runs/' + context.runId + ') for details.' + }); - name: 📤 Publish to Cloudflare Pages id: cloudflare @@ -110,6 +135,18 @@ jobs: projectName: graphite-dev directory: frontend/dist + - name: ❗ Warn on publish failure + if: ${{ failure() }} + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'The deployment to Cloudflare Pages has failed. Please check the [build logs](https://github.com/GraphiteEditor/Graphite/actions/runs/' + context.runId + ') for details. + }); + - name: 💬 Comment build link uses: actions/github-script@v6 with: