Skip to content

Commit 2a31b53

Browse files
committed
Run validation job on failure
1 parent 80f009e commit 2a31b53

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎.github/workflows/__unsupported-macos.yml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pr-checks/checks/unsupported-macos.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ validationJobs:
3333
unsupported-macos-sarif-checks:
3434
checkout: true
3535
installNode: true
36+
if: failure()
3637
steps:
3738
- name: Download workflow artifact
3839
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1

‎pr-checks/sync.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ interface JobSpecification {
124124

125125
type ValidationJobSpecification = JobSpecification & {
126126
checkout?: boolean;
127+
/** Optional condition for the validation job. */
128+
if?: string;
127129
};
128130

129131
/** Describes language/framework-specific steps and inputs. */
@@ -640,9 +642,14 @@ function generateValidationJob(
640642
// Add the generated steps in front of the ones from the specification.
641643
specSteps.items.unshift(...checkoutStep, ...steps);
642644

645+
const baseCondition = "github.triggering_actor != 'dependabot[bot]'";
646+
643647
const validationJob: Record<string, any> = {
644648
name: jobSpecification.name,
645-
if: "github.triggering_actor != 'dependabot[bot]'",
649+
if:
650+
jobSpecification.if !== undefined
651+
? `${baseCondition} && ${jobSpecification.if}`
652+
: baseCondition,
646653
needs: [checkName],
647654
permissions: {
648655
contents: "read",

0 commit comments

Comments
 (0)