1
0
mirror of https://github.com/TwiN/gatus.git synced 2026-02-04 12:56:48 +00:00

fix(ci): Adjust static asset generation workflow (#1480)

* fix(ci): Add comment workflow has no changes to commit

* refactor: Use github icon syntax

* feat(ci): Mention user who triggered the workflow

* fix: Get actor from context

* fix: Update incorrect variable name

* feat(ci): Add workflow link for all comments
This commit is contained in:
PythonGermany
2026-01-10 04:55:33 +01:00
committed by GitHub
parent 1bf05d6bf9
commit c93a321073

View File

@@ -83,20 +83,21 @@ jobs:
with: with:
script: | script: |
const status = '${{ needs.regenerate-static-assets.outputs.status }}'; const status = '${{ needs.regenerate-static-assets.outputs.status }}';
let reaction = ''; let reaction = 'hooray';
if (status === 'success') { let message = '';
reaction = 'hooray'; var workflowUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
} else if (status === 'no_changes') { if (status === 'no_changes') {
reaction = '+1'; message = `@${context.actor} No changes to commit after [regenerating static assets](${workflowUrl}) :tada:`;
} else { } else {
reaction = '-1'; reaction = '-1';
var workflowUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`; message = `@${context.actor} :warning: There was an issue regenerating static assets. Please check the [workflow run logs](${workflowUrl}) for more details.`;
var body = '⚠️ There was an issue regenerating static assets. Please check the [workflow run logs](' + workflowUrl + ') for more details.'; }
if (message.length) {
await github.rest.issues.createComment({ await github.rest.issues.createComment({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: context.issue.number, issue_number: context.issue.number,
body: body body: message
}); });
} }
await github.rest.reactions.createForIssueComment({ await github.rest.reactions.createForIssueComment({