From 0d94aab48f223c8aa3f0bb8fa09cf48591ac6196 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 17:43:45 +0000 Subject: [PATCH 1/7] Make prepare changelog script executable For local testing --- .github/workflows/script/prepare_changelog.py | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 .github/workflows/script/prepare_changelog.py diff --git a/.github/workflows/script/prepare_changelog.py b/.github/workflows/script/prepare_changelog.py old mode 100644 new mode 100755 index 24a062ce05..e9bcd0b922 --- a/.github/workflows/script/prepare_changelog.py +++ b/.github/workflows/script/prepare_changelog.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import os import sys From a7783c507b29a2c6e65a2d7310766c9d4e17a6cf Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 17:49:14 +0000 Subject: [PATCH 2/7] Make bundle changelog script executable For local testing --- .github/workflows/script/bundle_changelog.py | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 .github/workflows/script/bundle_changelog.py diff --git a/.github/workflows/script/bundle_changelog.py b/.github/workflows/script/bundle_changelog.py old mode 100644 new mode 100755 index 8a7135f1e4..58712e88c5 --- a/.github/workflows/script/bundle_changelog.py +++ b/.github/workflows/script/bundle_changelog.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import os import re From 064fafeb4914ba60950854a883db188d3303edee Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 17:51:27 +0000 Subject: [PATCH 3/7] Link CLI/language pack notes from new bundle changelog --- .github/workflows/script/bundle_changelog.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/bundle_changelog.py b/.github/workflows/script/bundle_changelog.py index 58712e88c5..fdaed64cfb 100755 --- a/.github/workflows/script/bundle_changelog.py +++ b/.github/workflows/script/bundle_changelog.py @@ -2,9 +2,15 @@ import os import re +cli_version = os.environ['CLI_VERSION'] + +# Link the GitHub Release corresponding to the new bundle version. +bundle_release_url = f"https://github.com/github/codeql-action/releases/codeql-bundle-v{cli_version}" +bundle_note = f"To learn more about the relevant changes to the CodeQL CLI and language packs, see the [bundle release]({bundle_release_url})." + # Get the PR number from the PR URL. pr_number = os.environ['PR_URL'].split('/')[-1] -changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})" +changelog_note = f"- Update default CodeQL bundle version to {cli_version}. {bundle_note} [#{pr_number}]({os.environ['PR_URL']})" # If the "[UNRELEASED]" section starts with "no user facing changes", remove that line. with open('CHANGELOG.md', 'r') as f: From 4d4ae1fbe8dac2f69aa926622a9de8e194065acd Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 17:55:06 +0000 Subject: [PATCH 4/7] Abridge release notes for Action GH release --- .github/workflows/script/prepare_changelog.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/script/prepare_changelog.py b/.github/workflows/script/prepare_changelog.py index e9bcd0b922..b4bb7bb3dc 100755 --- a/.github/workflows/script/prepare_changelog.py +++ b/.github/workflows/script/prepare_changelog.py @@ -18,16 +18,15 @@ def extract_changelog_snippet(changelog_file, version_tag): # Include everything up to, but excluding the second heading found_first_section = False - for i, line in enumerate(lines): + for line in lines: if line.startswith('## '): if found_first_section: break found_first_section = True - output += line + elif found_first_section: + output += line - output += f"See the full [CHANGELOG.md](https://github.com/github/codeql-action/blob/{version_tag}/CHANGELOG.md) for more information." - - return output + return output.strip() if len(sys.argv) < 3: From 3a7caafd7343453355360f8c336d6b653d6e2ceb Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 17:57:59 +0000 Subject: [PATCH 5/7] Update comment --- .github/workflows/script/prepare_changelog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/script/prepare_changelog.py b/.github/workflows/script/prepare_changelog.py index b4bb7bb3dc..8be8d836fa 100755 --- a/.github/workflows/script/prepare_changelog.py +++ b/.github/workflows/script/prepare_changelog.py @@ -16,7 +16,7 @@ def extract_changelog_snippet(changelog_file, version_tag): with open(changelog_file, 'r') as f: lines = f.readlines() - # Include everything up to, but excluding the second heading + # Include only the contents of the first section found_first_section = False for line in lines: if line.startswith('## '): From d51b375a03165b7639010d93b0cb323229431063 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 17:59:04 +0000 Subject: [PATCH 6/7] Drop unneeded version tag argument --- .github/workflows/post-release-mergeback.yml | 3 +-- .github/workflows/rollback-release.yml | 3 +-- .github/workflows/script/prepare_changelog.py | 10 ++++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/post-release-mergeback.yml b/.github/workflows/post-release-mergeback.yml index 71091e6d44..95e66ecd79 100644 --- a/.github/workflows/post-release-mergeback.yml +++ b/.github/workflows/post-release-mergeback.yml @@ -123,9 +123,8 @@ jobs: - name: Prepare partial Changelog env: PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" - VERSION: "${{ steps.getVersion.outputs.version }}" run: | - python .github/workflows/script/prepare_changelog.py CHANGELOG.md "$VERSION" > $PARTIAL_CHANGELOG + python .github/workflows/script/prepare_changelog.py CHANGELOG.md > $PARTIAL_CHANGELOG echo "::group::Partial CHANGELOG" cat $PARTIAL_CHANGELOG diff --git a/.github/workflows/rollback-release.yml b/.github/workflows/rollback-release.yml index 5c3b7efdd1..4b5b68cf36 100644 --- a/.github/workflows/rollback-release.yml +++ b/.github/workflows/rollback-release.yml @@ -127,9 +127,8 @@ jobs: env: NEW_CHANGELOG: "${{ runner.temp }}/new_changelog.md" PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md" - VERSION: "${{ needs.prepare.outputs.version }}" run: | - python .github/workflows/script/prepare_changelog.py $NEW_CHANGELOG "$VERSION" > $PARTIAL_CHANGELOG + python .github/workflows/script/prepare_changelog.py $NEW_CHANGELOG > $PARTIAL_CHANGELOG echo "::group::Partial CHANGELOG" cat $PARTIAL_CHANGELOG diff --git a/.github/workflows/script/prepare_changelog.py b/.github/workflows/script/prepare_changelog.py index 8be8d836fa..dafb84b39c 100755 --- a/.github/workflows/script/prepare_changelog.py +++ b/.github/workflows/script/prepare_changelog.py @@ -7,7 +7,7 @@ # Prepare the changelog for the new release # This function will extract the part of the changelog that # we want to include in the new release. -def extract_changelog_snippet(changelog_file, version_tag): +def extract_changelog_snippet(changelog_file): output = '' if (not os.path.exists(changelog_file)): output = EMPTY_CHANGELOG @@ -29,9 +29,7 @@ def extract_changelog_snippet(changelog_file, version_tag): return output.strip() -if len(sys.argv) < 3: - raise Exception('Expecting argument: changelog_file version_tag') +if len(sys.argv) < 2: + raise Exception('Expecting argument: changelog_file') changelog_file = sys.argv[1] -version_tag = sys.argv[2] - -print(extract_changelog_snippet(changelog_file, version_tag)) +print(extract_changelog_snippet(changelog_file)) From ebffc48bf58a8e88912038447783141dd41cc759 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 19 Jan 2026 18:00:34 +0000 Subject: [PATCH 7/7] Include `/tag` in bundle release URL Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/script/bundle_changelog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/script/bundle_changelog.py b/.github/workflows/script/bundle_changelog.py index fdaed64cfb..42a9589a8b 100755 --- a/.github/workflows/script/bundle_changelog.py +++ b/.github/workflows/script/bundle_changelog.py @@ -5,7 +5,7 @@ cli_version = os.environ['CLI_VERSION'] # Link the GitHub Release corresponding to the new bundle version. -bundle_release_url = f"https://github.com/github/codeql-action/releases/codeql-bundle-v{cli_version}" +bundle_release_url = f"https://github.com/github/codeql-action/releases/tag/codeql-bundle-v{cli_version}" bundle_note = f"To learn more about the relevant changes to the CodeQL CLI and language packs, see the [bundle release]({bundle_release_url})." # Get the PR number from the PR URL.