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 <keavon@keavon.com>
This commit is contained in:
parent
723f7b14ea
commit
3b1a51b393
|
|
@ -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
|
echo "Failed to detect if the build command written in the comment should have been '!build-dev', '!build-profiling', or '!build'" >> $GITHUB_OUTPUT
|
||||||
fi
|
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
|
- name: 🌐 Build Graphite web code
|
||||||
env:
|
env:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
|
if: ${{ success() || failure()}}
|
||||||
run: |
|
run: |
|
||||||
cd frontend
|
cd frontend
|
||||||
mold -run npm run ${{ steps.build_command.outputs.command }}
|
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
|
- name: 📤 Publish to Cloudflare Pages
|
||||||
id: cloudflare
|
id: cloudflare
|
||||||
|
|
@ -110,6 +135,18 @@ jobs:
|
||||||
projectName: graphite-dev
|
projectName: graphite-dev
|
||||||
directory: frontend/dist
|
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
|
- name: 💬 Comment build link
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue