Skip to content

Commit

Permalink
Merge pull request #20 from dreadnode/workflow/improve-workflow-valid…
Browse files Browse the repository at this point in the history
…ation-outputs

chore: improve workflow stdout comments
  • Loading branch information
evilsocket authored Nov 8, 2024
2 parents ffe792d + 42f45ca commit 1878919
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/validate_robopages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});

0 comments on commit 1878919

Please sign in to comment.