Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
b2b77a8
Add CHANGELOG.md modification check and warning comment
mario-campos Oct 8, 2026
fbd33ac
Gate comment-post step on successful fetch-base
mario-campos Oct 8, 2026
43ac64c
Use `gh api` instead of third-party Action
mario-campos Oct 8, 2026
f7aa9dc
Move post-comment step to `post-pr-comments` job
mario-campos Oct 8, 2026
780e947
Skip CHANGELOG.md modification warning for release and backport PRs
mario-campos Oct 8, 2026
ae75d46
Exclude "Mergeback" and "Update default bundle" PRs from CHANGELOG.md…
mario-campos Oct 8, 2026
6e4d3fb
Use a sticky comment to warn about CHANGELOG.md changes
mario-campos Oct 8, 2026
d97a656
Update CHANGELOG.md warning message to reference change-notes directory
mario-campos Oct 8, 2026
ccdf690
Escape backticks PR comment body
mario-campos Oct 8, 2026
928548a
Refine exclusion conditions for CHANGELOG-modification comment
mario-campos Oct 8, 2026
0707124
Delete CHANGELOG.md-modification comment if CHANGELOG.md no longer mo…
mario-campos Oct 8, 2026
27d37d9
Format all file references as inline Markdown code spans
mario-campos Oct 8, 2026
9fe741e
Simplify `if` condition of CHANGELOG-comment-post step
mario-campos Oct 8, 2026
8c8b082
Add script and Action for managing PR comments
mario-campos Oct 9, 2026
14cefaa
Replace bash/run step with local Action `post-comment`
mario-campos Oct 9, 2026
4d464b0
Improve issue ID parsing and validation logic
mario-campos Oct 9, 2026
3c452a1
Use HTTP link to `unreleased-change-notes/README.md`
mario-campos Oct 9, 2026
f1419b8
Reject empty `--marker`
mario-campos Oct 9, 2026
e7dadca
Refactor comment handling logic into `performAction` for improved tes…
mario-campos Oct 9, 2026
ae9f97b
Make post-comment marker configurable
mario-campos Oct 28, 2026
90d1bc9
Remove bespoke post-comment argument validation
mario-campos Oct 28, 2026
ae23865
Move comment branching into workflow steps
mario-campos Oct 28, 2026
9448877
Simplify post-comment to a single set-comment mode
mario-campos Oct 28, 2026
03137fc
Rename changelog outputs to modified
mario-campos Oct 28, 2026
36f220a
Remove unused post-comment step IDs
mario-campos Oct 28, 2026
c069d49
Test sticky comments using observable state
mario-campos Oct 28, 2026
afaf324
Move `resolveToken` to `pr-checks/api-client.ts`
mario-campos Oct 29, 2026
3fb676f
Use existing `RepositoryNwo` type
mario-campos Oct 29, 2026
56fa196
Use YAML multiline string for the Action's inputs' descriptions
mario-campos Oct 29, 2026
2902eea
Checkout `main` instead of PR's base for the `post-pr-comments` job
mario-campos Oct 29, 2026
87cac24
Avoid sparse checkout
mario-campos Oct 29, 2026
5bb3554
Make input-validation assertions more granular
mario-campos Oct 29, 2026
f13bcf3
Warn if more than one marked comment was found
mario-campos Oct 29, 2026
19e1ab5
Update `pr-checks/post-comment.ts` description comment
mario-campos Oct 29, 2026
9359b6b
Wrap `--marker` argument in HTML comment tags automatically
mario-campos Oct 29, 2026
e965148
Avoid non-null assertion operators by asserting arguments
mario-campos Oct 29, 2026
94f0998
Avoid creating resolved comments without an existing warning
mario-campos Oct 29, 2026
1304cc4
Potential fix for pull request finding 'CodeQL / Missing space in str…
mario-campos Oct 29, 2026
68a9dcb
Prefer `== true` over `!= false`
mario-campos Oct 30, 2026
1a18e90
Merge branch 'main' into mario-campos/warn-on-changelog-write
mario-campos Oct 30, 2026
a587867
Update `actions/setup-node` action to version 7.1.0
mario-campos Oct 30, 2026
0bc39f9
Prefer last comment when there are multiple to choose from
mario-campos Oct 30, 2026
b25bc2e
Change `RepositoryNwo` import to `type`
mario-campos Oct 30, 2026
8ba2b06
Use `parseRepositoryNwo` instead of splitting manually
mario-campos Oct 30, 2026
eec6442
Make precedence explicit with parens
mario-campos Oct 30, 2026
97a381d
Split long line
mario-campos Oct 30, 2026
9de5eac
Make error a bit clearer and more actionable
mario-campos Oct 30, 2026
d715939
Replace `--create-if-missing` to `--update-only`
mario-campos Oct 30, 2026
4094755
Polish `post-comment.ts` usage comment
mario-campos Nov 2, 2026
9d1378f
Use new `case` expression for evaluating conditional `--update-only` …
mario-campos Nov 2, 2026
05870b6
Defer workflow activation to a follow-up PR
mario-campos Nov 3, 2026
29ddace
Move `Feature` enum to a separate file
mbg Nov 4, 2026
e7ce43a
Log how long deleting each CodeQL version from the toolcache takes
henrymercer Nov 3, 2026
e70c041
Record how long the toolcache cleanup takes in telemetry
henrymercer Nov 4, 2026
8aab3d8
Merge pull request #4298 from github/mbg/decouple-features-enum
mbg Nov 4, 2026
8e42d38
Update changelog and version after v4.39.3
github-actions[bot] Nov 4, 2026
d11b224
Rebuild
github-actions[bot] Nov 4, 2026
0911ee9
Merge pull request #4303 from github/mergeback/v4.39.3-to-main-33d7b85d
sam-robson Nov 4, 2026
d2a785c
Remove `macos-14-xlarge` from `codeql` workflow
henrymercer Nov 6, 2026
822e91c
Exclude Notify from required checks
henrymercer Nov 6, 2026
e4ce43d
Merge pull request #4309 from github/henrymercer/replace-macos-14-xla…
henrymercer Nov 9, 2026
ce8b560
Merge pull request #4302 from github/henrymercer/toolcache-cleanup-du…
henrymercer Nov 9, 2026
fbfa9f3
Merge pull request #4311 from github/henrymercer/exclude-notify-from-…
mbg Nov 9, 2026
9d4eb28
Rename `linux-arm64` PR check to `runner-images`
henrymercer Nov 9, 2026
02e8a5d
Run `runner-images` check on the GitHub-hosted runner images with `li…
henrymercer Nov 9, 2026
3a7f564
Rerun failed `runner-images` jobs in the Deflake workflow
henrymercer Nov 9, 2026
b5a3632
Run `analyze-javascript` only on `ubuntu-26.04`
henrymercer Nov 9, 2026
97d0cc0
Only run `analyze-javascript` with the default CodeQL bundle
henrymercer Nov 9, 2026
cfb3940
Respect `use-all-platform-bundle` for the latest nightly in `prepare-…
henrymercer Nov 9, 2026
91bae3a
Check that the `all-platform-bundle` PR check uses an all-platform bu…
henrymercer Nov 9, 2026
4e3aa41
Remove the `CodeQL Bundle All` PR check, which duplicates `all-platfo…
henrymercer Nov 9, 2026
a6827a3
Merge `analyze-javascript` and `analyze-other` into one matrixed job
henrymercer Nov 9, 2026
592d162
Merge pull request #4312 from github/henrymercer/all-platform-bundle-…
henrymercer Nov 10, 2026
3ea37a4
Merge pull request #4217 from github/mario-campos/warn-on-changelog-w…
mario-campos Nov 11, 2026
f039c78
Warn about direct CHANGELOG.md changes in PR checks
mario-campos Nov 3, 2026
9e531e1
Install root dependencies for PR comment action
mario-campos Nov 3, 2026
f874b0c
Bump fast-xml-parser from 5.7.1 to 5.12.1
dependabot[bot] Nov 15, 2026
0c7ad84
Rebuild
github-actions[bot] Nov 15, 2026
b2b7b36
Merge pull request #4294 from github/mario-campos-changelog-workflow-…
mario-campos Nov 18, 2026
6903896
Bump the npm-minor group across 1 directory with 9 updates
dependabot[bot] Nov 18, 2026
c0775e2
Rebuild
github-actions[bot] Nov 18, 2026
08643f8
Merge branch 'main' into henrymercer/runner-image-coverage
henrymercer Nov 19, 2026
b4de9cd
Merge pull request #4313 from github/henrymercer/runner-image-coverage
henrymercer Nov 19, 2026
79d1def
Exclude renamed `Post PR comments` job from required checks
henrymercer Nov 19, 2026
80c8b99
Merge branch 'main' into dependabot/npm_and_yarn/npm-minor-04c9f5c560
henrymercer Nov 19, 2026
da2d380
Merge branch 'main' into dependabot/npm_and_yarn/fast-xml-parser-5.12.1
henrymercer Nov 19, 2026
0474445
Merge pull request #4329 from github/dependabot/npm_and_yarn/npm-mino…
henrymercer Nov 19, 2026
f8c39e2
Merge pull request #4328 from github/dependabot/npm_and_yarn/fast-xml…
henrymercer Nov 19, 2026
55aa1d2
Merge pull request #4331 from github/henrymercer/exclude-post-pr-comm…
henrymercer Nov 19, 2026
5f85401
Update default bundle to codeql-bundle-v2.27.5
github-actions[bot] Nov 19, 2026
ff59388
Add changenote
github-actions[bot] Nov 19, 2026
e9c4b4b
Merge pull request #4333 from github/update-bundle/codeql-bundle-v2.27.5
sam-robson Nov 19, 2026
4302074
Update changelog for v4.39.4
github-actions[bot] Nov 20, 2026
1bd86f2
Merge pull request #4336 from github/update-v4.39.4-e9c4b4b15
sam-robson Nov 20, 2026
a34e2a4
Revert "Update version and changelog for v3.39.3"
github-actions[bot] Nov 20, 2026
a6298f5
Revert "Rebuild"
github-actions[bot] Nov 20, 2026
a120989
Merge remote-tracking branch 'origin/releases/v4' into backport-v3.39…
github-actions[bot] Nov 20, 2026
d1bb1e2
Update version and changelog for v3.39.4
github-actions[bot] Nov 20, 2026
a1fabef
Rebuild
github-actions[bot] Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/post-comment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Post comment"
description: "Create or update a sticky PR comment identified by a caller-provided marker."
inputs:
marker:
description: >
Non-empty plain-text identifier for the comment. Use a unique, stable value
for each distinct comment; it is automatically wrapped in a hidden HTML comment.
required: true
body:
description: "Full comment markdown."
required: true
update-only:
description: Do nothing if no comment with the specified marker exists.
required: false
default: "false"
issue-id:
description: >
The issue or pull request number to post/update the comment on.
Defaults to the current pull request if not provided.
required: false
token:
description: "The GitHub token to authenticate with."
required: true
runs:
using: composite
steps:
- name: Post comment
shell: bash
env:
BODY: ${{ inputs.body }}
MARKER: ${{ inputs.marker }}
UPDATE_ONLY: ${{ case(inputs.update-only == 'true', '--update-only', '') }}
GH_TOKEN: ${{ inputs.token }}
ISSUE_ID: ${{ inputs.issue-id || github.event.pull_request.number }}
run: |
npx tsx ./pr-checks/post-comment.ts \
--body "$BODY" \
--marker "$MARKER" \
$UPDATE_ONLY \
--issue-id "$ISSUE_ID" \
--repository "$GITHUB_REPOSITORY"
9 changes: 8 additions & 1 deletion .github/actions/prepare-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ runs:
set -e # Fail this Action if `gh release list` fails.
if [[ "$VERSION" == "nightly" || "$VERSION" == "nightly-latest" ]]; then
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
# With `tools: nightly`, the Action downloads the bundle for the runner's platform, so look
# up the latest nightly release here to get its all-platform bundle instead.
tag=$(gh release list --repo dsp-testing/codeql-cli-nightlies --limit 1 --json tagName --jq '.[0].tagName')
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/codeql-bundle.tar.gz" >> "$GITHUB_OUTPUT"
else
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
fi
exit 0
elif [[ "$VERSION" == "linked" ]]; then
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
Expand Down
5 changes: 5 additions & 0 deletions .github/codeql/codeql-config-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
paths-ignore:
- lib
- tests
queries:
- uses: security-and-quality
12 changes: 12 additions & 0 deletions .github/workflows/__all-platform-bundle.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 7 additions & 95 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,70 +19,16 @@ env:
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks

jobs:
# Identify the CodeQL tool versions to use in the analysis job.
check-codeql-versions:
analyze:
if: github.triggering_actor != 'dependabot[bot]'
runs-on: ubuntu-26.04
outputs:
versions: ${{ steps.compare.outputs.versions }}

permissions:
contents: read
# We currently need `security-events: read` to access feature flags.
security-events: read

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up default CodeQL bundle
id: setup-default
uses: ./setup-codeql
- name: Set up linked CodeQL bundle
id: setup-linked
uses: ./setup-codeql
with:
tools: linked
- name: Compare default and linked CodeQL bundle versions
id: compare
env:
CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }}
CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }}
run: |
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)"
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED"

# If we're running on a pull request, run with both bundles, even if `tools: linked` would
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
# required status check.
#
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
# the same as running with `tools: null`.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then
VERSIONS_JSON='[null]'
else
VERSIONS_JSON='[null, "linked"]'
fi

# Output a JSON-encoded list with the distinct versions to test against.
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT

analyze-javascript:
if: github.triggering_actor != 'dependabot[bot]'
needs: [check-codeql-versions]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
- windows-2022
- windows-2025
- macos-14-xlarge
- macos-15-xlarge
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}
language:
- actions
- javascript

permissions:
contents: read
Expand All @@ -95,49 +41,15 @@ jobs:
uses: ./init
id: init
with:
languages: javascript
config-file: ./.github/codeql/codeql-config-javascript.yml
tools: ${{ matrix.tools }}
languages: ${{ matrix.language }}
build-mode: none
config-file: ./.github/codeql/codeql-config-${{ matrix.language }}.yml
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: >
"$CODEQL" version --format=json
env:
CODEQL: ${{steps.init.outputs.codeql-path}}
- name: Perform CodeQL Analysis
uses: ./analyze
with:
category: "/language:javascript"
upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }}

analyze-other:
if: github.triggering_actor != 'dependabot[bot]'
runs-on: ubuntu-26.04

strategy:
fail-fast: false
matrix:
include:
- language: actions

permissions:
contents: read
security-events: write

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: ./init
with:
languages: ${{ matrix.language }}
build-mode: none
config: >
paths-ignore:
- lib
- tests
queries:
- uses: security-and-quality
- name: Perform CodeQL Analysis
uses: ./analyze
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deflake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ on:
- "PR Check - C/C\\+\\+: autoinstalling dependencies is skipped (macOS)"
- "PR Check - C/C\\+\\+: disabling autoinstalling dependencies (Linux)"
- "PR Check - Clean up database cluster directory"
- "PR Check - CodeQL Bundle All"
- "PR Check - Config export"
- "PR Check - Config input"
- "PR Check - Custom source root"
Expand Down Expand Up @@ -61,6 +60,7 @@ on:
- "PR Check - Remote config file"
- "PR Check - Resolve environment"
- "PR Check - Ruby analysis"
- "PR Check - Runner images"
- "PR Check - Rust analysis"
- "PR Check - Split workflow"
- "PR Check - Start proxy"
Expand Down
75 changes: 73 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
contents: read
runs-on: ubuntu-26.04
timeout-minutes: 10
outputs:
changelog-modified: ${{ steps.changelog-check.outputs.modified }}

concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
Expand Down Expand Up @@ -191,6 +193,20 @@ jobs:
path: ${{ runner.temp }}/repo-size/
if-no-files-found: error

- name: Check for CHANGELOG.md changes
id: changelog-check
if: steps.fetch-base.outcome == 'success'
env:
BASE_SHA: ${{ steps.fetch-base.outputs.merge_base }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
if ! git diff --exit-code --quiet "$BASE_SHA" "$HEAD_SHA" -- CHANGELOG.md; then
echo "CHANGELOG.md was modified in this PR."
echo "modified=true" >> "$GITHUB_OUTPUT"
else
echo "modified=false" >> "$GITHUB_OUTPUT"
fi

- name: "Backport: Check out base ref"
id: checkout-base
if: ${{ startsWith(github.head_ref, 'backport-') }}
Expand All @@ -211,8 +227,8 @@ jobs:
exit 1
fi

post-repo-size-comment:
name: Post repo size comment
post-pr-comments:
name: Post PR comments
needs: other-checks
# Keep write permissions isolated from the job that checks out and tests PR code. This job only
# posts the candidate comment body produced by the read-only `pr-checks` job.
Expand All @@ -232,6 +248,22 @@ jobs:
group: check-repo-size-${{ github.event.pull_request.number }}

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Check out main, not the PR's head, since this job runs with
# `pull-requests: write` permissions and must not execute untrusted code from the PR.
ref: main

- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: "npm"

- name: Install dependencies
run: npm ci --workspace=pr-checks --include-workspace-root

- name: Download repo size comment
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
Expand Down Expand Up @@ -261,3 +293,42 @@ jobs:
else
echo "Skipping repo size comment because the delta is below the threshold and no sticky comment exists."
fi

- name: Post a warning about modifying CHANGELOG.md
# Release, backport, mergeback, and bundle-update PRs deliberately modify CHANGELOG.md,
# so skip comment management entirely for these automation flows.
if: >-
needs.other-checks.outputs.changelog-modified == 'true' &&
!startsWith(github.event.pull_request.head.ref, 'update-v') &&
!startsWith(github.event.pull_request.head.ref, 'backport-v') &&
!startsWith(github.event.pull_request.head.ref, 'mergeback/') &&
!startsWith(github.event.pull_request.head.ref, 'update-bundle/')
uses: ./.github/actions/post-comment
with:
marker: "post-comment:CHANGELOG.md"
body: |
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`
file will be automatically generated from those change-notes.
See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information.
token: ${{ secrets.GITHUB_TOKEN }}

- name: Mark the CHANGELOG.md concern as resolved
if: >-
needs.other-checks.outputs.changelog-modified == 'false' &&
!startsWith(github.event.pull_request.head.ref, 'update-v') &&
!startsWith(github.event.pull_request.head.ref, 'backport-v') &&
!startsWith(github.event.pull_request.head.ref, 'mergeback/') &&
!startsWith(github.event.pull_request.head.ref, 'update-bundle/')
uses: ./.github/actions/post-comment
with:
marker: "post-comment:CHANGELOG.md"
update-only: true
body: |
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`
file will be automatically generated from those change-notes.
See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information.

**Edit:** `CHANGELOG.md` is no longer modified in this PR. This concern is resolved.
token: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading