From 42f45ca71358f5552526a0722fc9af848d4c649c Mon Sep 17 00:00:00 2001 From: Ads Dawson <104169244+GangGreenTemperTatum@users.noreply.github.com> Date: Fri, 8 Nov 2024 07:21:17 -0500 Subject: [PATCH] chore: improve workflow stdout comments --- .github/workflows/validate_robopages.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate_robopages.yml b/.github/workflows/validate_robopages.yml index 9419aa7..b379e82 100644 --- a/.github/workflows/validate_robopages.yml +++ b/.github/workflows/validate_robopages.yml @@ -68,14 +68,27 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #7.0.1 with: script: | - const validation_status = '${{ steps.robopages-validation.outcome }}' === 'success' - ? '✅ Validation successful' - : '❌ Validation failed'; + const validation_status = '${{ steps.robopages-validation.outcome }}' === 'success' ? '✅ Validation successful' : '❌ Validation failed'; + const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; + const timestamp = new Date().toISOString(); + const body = [ + `## Validation Results (${timestamp})`, + '', + validation_status, + '', + 'Please ensure your contribution follows the required format.', + '', + `🔍 [View Full Validation Details](${runUrl})`, + '', + '---', + `Run ID: \`${process.env.GITHUB_RUN_ID}\``, + `Workflow: ${process.env.GITHUB_WORKFLOW}` + ].join('\n'); github.rest.pulls.createReview({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number, - body: `## Validation Results\n${validation_status}\n\nPlease ensure your contribution follows the required format.`, + body: body, event: 'COMMENT' }); \ No newline at end of file