Skip to content

Commit 4cf1c53

Browse files
authored
Merge pull request #3518 from github/mbg/ci/merge-queue-codeql
Fix CodeQL workflow for merge queue and exclude PR size workflow from required checks
2 parents b0ed4de + 2af7eb8 commit 4cf1c53

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
#
6767
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
6868
# the same as running with `tools: null`.
69-
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
69+
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LATEST" ]]; then
7070
VERSIONS_JSON='[null]'
7171
else
7272
VERSIONS_JSON='[null, "linked"]'

.github/workflows/codescanning-config-cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ jobs:
8080
# On PRs, overlay analysis may change the config that is passed to the CLI.
8181
# Therefore, we have two variants of the following test, one for PRs and one for other events.
8282
- name: Empty file (non-PR)
83-
if: github.event_name != 'pull_request' && github.event_name != 'merge_group'
83+
if: github.event_name != 'pull_request'
8484
uses: ./../action/.github/actions/check-codescanning-config
8585
with:
8686
expected-config-file-contents: "{}"
8787
languages: javascript
8888
tools: ${{ steps.prepare-test.outputs.tools-url }}
8989

9090
- name: Empty file (PR)
91-
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
91+
if: github.event_name == 'pull_request'
9292
uses: ./../action/.github/actions/check-codescanning-config
9393
with:
9494
expected-config-file-contents: |

.github/workflows/script/update-required-checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929
echo "Getting checks for $GITHUB_SHA"
3030

3131
# Ignore any checks with "https://", CodeQL, LGTM, Update, and ESLint checks.
32-
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") or . == "Agent" or . == "Cleanup artifacts" or . == "Prepare" or . == "Upload results" | not)] | unique | sort')"
32+
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") or . == "Agent" or . == "Cleanup artifacts" or . == "Prepare" or . == "Upload results" or . == "Label PR with size" | not)] | unique | sort')"
3333

3434
echo "$CHECKS" | jq
3535

0 commit comments

Comments
 (0)