Skip to content

Commit

Permalink
Add better output to PR inspection step to show results for each check
Browse files Browse the repository at this point in the history
  • Loading branch information
jlantz committed Sep 6, 2024
1 parent 7adfd63 commit 5f7562f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/feature-test-2gp-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,21 @@ jobs:
if (pullRequests.length > 0) {
const pr = pullRequests[0];
console.log('PR found:', pr.number);
const is_draft = pr.draft.toString();
console.log('PR is draft:', is_draft);
const labels = pr.labels.map(label => label.name);
const has_snapshot_label = labels.includes('${{ inputs.snapshot-pr-label }}');
console.log('PR has snapshot label:', has_snapshot_label);
const has_snapshot_fail_label = labels.includes('${{ inputs.snapshot-fail-pr-label }}');
console.log('PR has snapshot fail label:', has_snapshot_fail_label);
core.setOutput('pr-number', pr.number);
core.setOutput('has-pr', 'true');
core.setOutput('is-draft', pr.draft.toString());
const labels = pr.labels.map(label => label.name);
core.setOutput('has-snapshot-label', labels.includes('${{ inputs.snapshot-pr-label }}').toString());
core.setOutput('has-snapshot-fail-label', labels.includes('${{ inputs.snapshot-fail-pr-label }}').toString());
core.setOutput('is-draft', is_draft);
core.setOutput('has-snapshot-label', has_snapshot_label);
core.setOutput('has-snapshot-fail-label', has_snapshot_fail_label);
} else {
console.log('No PR found');
core.setOutput('has-pr', 'false');
Expand Down

0 comments on commit 5f7562f

Please sign in to comment.