Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
054745b
Convert `release-branches.py` to TypeScript
mbg Mar 13, 2026
aa27731
Install `node` in `release-initialise` action
mbg Mar 13, 2026
3db9a05
Replace `release-branches.py` with TS version in `release-branches` a…
mbg Mar 13, 2026
0d87a75
Refactor backport computation into `computeReleaseBranches`
mbg Mar 13, 2026
b72f4fe
Validate inputs
mbg Mar 13, 2026
49af37b
Add tests for `release-branches.ts`
mbg Mar 13, 2026
4867f59
Add config file for excluded checks from `update-required-checks.sh`
mbg Mar 13, 2026
9813849
Add initial TS implementation of `update-required-checks.sh`
mbg Mar 13, 2026
9481177
Initialise API client
mbg Mar 13, 2026
d2008ee
Add type to represent `exclusions.yml` and loading helper
mbg Mar 13, 2026
1bc611e
Fetch and filter check runs for `ref`
mbg Mar 13, 2026
a5244bf
Fetch release branches and identify major versions
mbg Mar 13, 2026
74dd691
Identify changes before applying them
mbg Mar 13, 2026
4cec5d2
Call `updateBranch` for `main`
mbg Mar 13, 2026
0543156
Actually perform the update when necessary and requested
mbg Mar 13, 2026
c5a984e
Update `CONTRIBUTING.md`
mbg Mar 13, 2026
9fe42f6
Add some unit tests for `sync-checks.ts`
mbg Mar 13, 2026
cfc1878
Rebuild
mbg Mar 16, 2026
75ed461
Add `excluded.yml` path to `config.ts`
mbg Mar 16, 2026
9fd40ff
Tidy up `pr-checks/package.json`
mbg Mar 16, 2026
07f235e
Add `--verbose` option
mbg Mar 16, 2026
0abe92e
Configure ESLint `import/no-extraneous-dependencies` rule for `pr-che…
mbg Mar 16, 2026
0da3139
Rename to `branchName`
mbg Mar 25, 2026
fa568eb
Delete `release-branches.py`
mbg Mar 25, 2026
e7c7b68
Remove `update-required-checks.sh`
mbg Mar 25, 2026
661a8fb
Default `ref` to `main`
mbg Mar 25, 2026
fae4c28
Update `CONTRIBUTING.md`
mbg Mar 25, 2026
a5418e1
Delete `releases.ini`
mbg Mar 25, 2026
8a0b4f2
fixup! Update `CONTRIBUTING.md`
mbg Mar 25, 2026
972365e
Fix comment
mbg Mar 25, 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
3 changes: 2 additions & 1 deletion .github/actions/release-branches/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ runs:
MAJOR_VERSION: ${{ inputs.major_version }}
LATEST_TAG: ${{ inputs.latest_tag }}
run: |
python ${{ github.action_path }}/release-branches.py \
npm ci
npx tsx ./pr-checks/release-branches.ts \
--major-version "$MAJOR_VERSION" \
--latest-tag "$LATEST_TAG"
shell: bash
55 changes: 0 additions & 55 deletions .github/actions/release-branches/release-branches.py

This file was deleted.

6 changes: 6 additions & 0 deletions .github/actions/release-initialise/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ runs:
run: echo "$GITHUB_CONTEXT"
shell: bash

- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'

- name: Set up Python
uses: actions/setup-python@v6
with:
Expand Down
1 change: 0 additions & 1 deletion .github/releases.ini

This file was deleted.

64 changes: 0 additions & 64 deletions .github/workflows/script/update-required-checks.sh

This file was deleted.

12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ Once the mergeback and backport pull request have been merged, the release is co

## Keeping the PR checks up to date (admin access required)

Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred required jobs that need to pass in order for a PR to turn green. It would be too tedious to maintain that list manually. You can regenerate the set of required checks automatically by running the [update-required-checks.sh](.github/workflows/script/update-required-checks.sh) script:
Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred required jobs that need to pass in order for a PR to turn green. It would be too tedious to maintain that list manually. You can regenerate the set of required checks automatically by running the [sync-checks.ts](pr-checks/sync-checks.ts) script:

- If you run the script without an argument, it will retrieve the set of workflows that ran for the latest commit on `main`. Make sure that your local `main` branch is up to date before running the script.
- You can specify a commit SHA as argument to retrieve the set of workflows for that commit instead. You will likely want to use this if you have a PR that removes or adds PR checks.
- At a minimum, you must provide an argument for the `--token` input. For example, `--token "$(gh auth token)"` to use the same token that `gh` uses. If no token is provided or the token has insufficient permissions, the script will fail.
- By default, the script performs a dry run and outputs information about the changes it would make to the branch protection rules. To actually apply the changes, specify the `--apply` flag.
- If you run the script without any other arguments, it will retrieve the set of workflows that ran for the latest commit on `main`.
- You can specify a different git ref with the `--ref` input. You will likely want to use this if you have a PR that removes or adds PR checks. For example, `--ref "some/branch/name"` to use the HEAD of the `some/branch/name` branch.

After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v3`, and any other currently supported major versions have been updated.
After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v4`, and any other currently supported major versions have been updated.

Note that any updates to checks on `main` need to be backported to all currently supported major version branches, in order to maintain the same set of names for required checks.

Expand Down Expand Up @@ -122,7 +124,7 @@ To deprecate an older version of the Action:
- Implement an Actions warning for customers using the deprecated version.
1. Wait for the deprecation period to pass.
1. Upgrade the Actions warning for customers using the deprecated version to a non-fatal error, and mention that this version of the Action is no longer supported.
1. Make a PR to bump the `OLDEST_SUPPORTED_MAJOR_VERSION` in [releases.ini](.github/releases.ini). Once this PR is merged, the release process will no longer backport changes to the deprecated release version.
1. Make a PR to bump the `OLDEST_SUPPORTED_MAJOR_VERSION` in [config.ts](pr-checks/config.ts). Once this PR is merged, the release process will no longer backport changes to the deprecated release version.

## Resources

Expand Down
27 changes: 21 additions & 6 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import noAsyncForeach from "eslint-plugin-no-async-foreach";
import jsdoc from "eslint-plugin-jsdoc";
import tseslint from "typescript-eslint";
import globals from "globals";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const githubFlatConfigs = github.getFlatConfigs();

export default [
Expand Down Expand Up @@ -43,7 +47,7 @@ export default [
plugins: {
"import-x": importX,
"no-async-foreach": fixupPluginRules(noAsyncForeach),
"jsdoc": jsdoc,
jsdoc: jsdoc,
},

languageOptions: {
Expand All @@ -67,7 +71,13 @@ export default [

typescript: {},
},
"import/ignore": ["sinon", "uuid", "@octokit/plugin-retry", "del", "get-folder-size"],
"import/ignore": [
"sinon",
"uuid",
"@octokit/plugin-retry",
"del",
"get-folder-size",
],
"import-x/resolver-next": [
createTypeScriptImportResolver(),
createNodeResolver({
Expand Down Expand Up @@ -143,7 +153,7 @@ export default [
// We don't currently require full JSDoc coverage, so this rule
// should not error on missing @param annotations.
disableMissingParamChecks: true,
}
},
],
},
},
Expand All @@ -162,9 +172,9 @@ export default [
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
}
args: "all",
argsIgnorePattern: "^_",
},
],
"func-style": "off",
},
Expand All @@ -183,6 +193,11 @@ export default [
// The scripts in `pr-checks` are expected to output to the console.
"no-console": "off",

"import/no-extraneous-dependencies": [
"error",
{ packageDir: [__dirname, path.resolve(__dirname, "pr-checks")] },
],

"@typescript-eslint/no-floating-promises": [
"error",
{
Expand Down
20 changes: 10 additions & 10 deletions lib/analyze-action-post.js

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

20 changes: 10 additions & 10 deletions lib/analyze-action.js

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

Loading
Loading