mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
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:
37
.github/workflows/comment-!build-commands.yml
vendored
37
.github/workflows/comment-!build-commands.yml
vendored
@@ -92,13 +92,38 @@ 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
|
||||||
uses: cloudflare/pages-action@1
|
uses: cloudflare/pages-action@1
|
||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user