Skip to content

Commit 962925a

Browse files
authored
Merge pull request #700 from github/henrymercer/reduce-num-pr-check-jobs-on-push
Reduce the number of PR checks that are run on `push`
2 parents f1c75fc + b19f1f9 commit 962925a

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/pr-checks.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,17 @@ jobs:
351351
echo "Latest CodeQL bundle version is $CODEQL_VERSION_LATEST"
352352
echo "Nightly CodeQL bundle version is $CODEQL_VERSION_NIGHTLY"
353353
354-
# Run integration tests with all three bundles, even if `tools: latest` would be the same as
355-
# `tools: null`. This allows us to make all three kinds of integration tests required status
356-
# checks on PRs.
357-
VERSIONS_JSON="[null, \"$NIGHTLY_URL\", \"latest\"]"
354+
# If we're running on a pull request, run each integration test with all three bundles, even
355+
# if `tools: latest` would be the same as `tools: null`. This allows us to make the
356+
# integration test job for each of the three bundles a required status check.
357+
#
358+
# If we're running on push, then we can skip running with `tools: latest` when it would be
359+
# the same as running with `tools: null`.
360+
if [[ "$GITHUB_EVENT_NAME" == "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
361+
VERSIONS_JSON="[null, \"$NIGHTLY_URL\"]"
362+
else
363+
VERSIONS_JSON="[null, \"$NIGHTLY_URL\", \"latest\"]"
364+
fi
358365
359366
# Output a JSON-encoded list with the distinct versions to test against.
360367
echo "Suggested matrix config for integration tests: $VERSIONS_JSON"

0 commit comments

Comments
 (0)