1
0
mirror of https://github.com/TwiN/gatus.git synced 2026-02-04 09:31:45 +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:
script: |
const status = '${{ needs.regenerate-static-assets.outputs.status }}';
let reaction = '';
if (status === 'success') {
reaction = 'hooray';
} else if (status === 'no_changes') {
reaction = '+1';
let reaction = 'hooray';
let message = '';
var workflowUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
if (status === 'no_changes') {
message = `@${context.actor} No changes to commit after [regenerating static assets](${workflowUrl}) :tada:`;
} else {
reaction = '-1';
var workflowUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
var body = '⚠️ There was an issue regenerating static assets. Please check the [workflow run logs](' + workflowUrl + ') for more details.';
message = `@${context.actor} :warning: 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({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
body: message
});
}
await github.rest.reactions.createForIssueComment({