Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dcf89a7
Bump the npm group with 4 updates
dependabot[bot] Dec 13, 2023
0d8f348
Update checked-in dependencies
github-actions[bot] Dec 13, 2023
95591ba
Merge branch 'main' into dependabot/npm_and_yarn/npm-0a98872b3d
henrymercer Dec 13, 2023
2b2fb6b
Update changelog and version after v3.22.11
github-actions[bot] Dec 13, 2023
7813bda
Update checked-in dependencies
github-actions[bot] Dec 13, 2023
ebf5a83
Merge pull request #2035 from github/mergeback/v3.22.11-to-main-b374143c
nickfyson Dec 13, 2023
511f073
Merge pull request #2033 from github/dependabot/npm_and_yarn/npm-0a98…
henrymercer Dec 13, 2023
8e4a6c7
improve handling of changelog processing for backports
nickfyson Dec 15, 2023
e0c2b0a
change version numbers inside processing function as well
nickfyson Dec 15, 2023
ee53012
Apply suggestions from code review
nickfyson Dec 15, 2023
fda1796
rename regex for clarity
nickfyson Dec 15, 2023
0724061
preserve trailing whitespace when transforming CHANGELOG
nickfyson Dec 18, 2023
8e086df
raise explicit exception if EOF found when looking for changelog sect…
nickfyson Dec 18, 2023
cda785e
add note on versioning approach to changelog
nickfyson Dec 18, 2023
144b7d5
Bump the npm group with 2 updates (#2045)
dependabot[bot] Dec 18, 2023
0978396
Merge pull request #2041 from github/nickfyson/fix-changelog-backports
nickfyson Dec 18, 2023
8478e2a
clarify comment on versions in the changelog
nickfyson Dec 18, 2023
2603673
clarify comment on versions in the changelog
nickfyson Dec 18, 2023
7e187e1
Merge pull request #2044 from github/nickfyson/update-changelog
nickfyson Dec 18, 2023
fe1e55f
Update default bundle to codeql-bundle-v2.15.5
github-actions[bot] Dec 19, 2023
a99bd84
Add changelog note
github-actions[bot] Dec 19, 2023
a110746
Merge pull request #2047 from github/update-bundle/codeql-bundle-v2.15.5
adityasharad Dec 20, 2023
a42c9a2
update required checks script to handle release branches
nickfyson Dec 20, 2023
9ed5fc7
add note about backporting check changes to v2 branch
nickfyson Dec 20, 2023
49812ec
Merge pull request #2050 from github/nickfyson/add-releases-ini
nickfyson Dec 20, 2023
658e3c6
Fix type error
angelapwen Dec 21, 2023
0be9290
Typecast `OLDEST_SUPPORTED_MAJOR_VERSION` when defined
angelapwen Dec 21, 2023
40cb08c
Merge pull request #2051 from github/angelapwen/patch-release-script
adityasharad Dec 21, 2023
c1cf794
Update changelog for v3.22.12
github-actions[bot] Dec 22, 2023
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
11 changes: 9 additions & 2 deletions .github/actions/release-branches/release-branches.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import argparse
import json
import os
import subprocess
import configparser

# Name of the remote
ORIGIN = 'origin'

OLDEST_SUPPORTED_MAJOR_VERSION = 2
script_dir = os.path.dirname(os.path.realpath(__file__))
grandparent_dir = os.path.dirname(os.path.dirname(script_dir))

config = configparser.ConfigParser()
with open(os.path.join(grandparent_dir, 'releases.ini')) as stream:
config.read_string('[default]\n' + stream.read())

OLDEST_SUPPORTED_MAJOR_VERSION = config['default']['OLDEST_SUPPORTED_MAJOR_VERSION']

def main():

Expand Down
1 change: 1 addition & 0 deletions .github/releases.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OLDEST_SUPPORTED_MAJOR_VERSION=2
22 changes: 21 additions & 1 deletion .github/workflows/script/update-required-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Update the required checks based on the current branch.
# Typically, this will be main.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
REPO_DIR="$(dirname "$SCRIPT_DIR")"
GRANDPARENT_DIR="$(dirname "$REPO_DIR")"
source "$GRANDPARENT_DIR/releases.ini"

if ! gh auth status 2>/dev/null; then
gh auth status
echo "Failed: Not authorized. This script requires admin access to github/codeql-action through the gh CLI."
Expand Down Expand Up @@ -29,7 +34,22 @@ echo "$CHECKS" | jq

echo "{\"contexts\": ${CHECKS}}" > checks.json

for BRANCH in main releases/v2; do
echo "Updating main"
gh api --silent -X "PATCH" "repos/github/codeql-action/branches/main/protection/required_status_checks" --input checks.json

# list all branchs on origin remote matching releases/v*
BRANCHES="$(git ls-remote --heads origin 'releases/v*' | sed 's?.*refs/heads/??' | sort -V)"

for BRANCH in $BRANCHES; do

# strip exact 'releases/v' prefix from $BRANCH using count of characters
VERSION="${BRANCH:10}"

if [ "$VERSION" -lt "$OLDEST_SUPPORTED_MAJOR_VERSION" ]; then
echo "Skipping $BRANCH"
continue
fi

echo "Updating $BRANCH"
gh api --silent -X "PATCH" "repos/github/codeql-action/branches/$BRANCH/protection/required_status_checks" --input checks.json
done
Expand Down
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ Since the `codeql-action` runs most of its testing through individual Actions wo

1. By default, this script retrieves the checks from the latest SHA on `main`, so make sure that your `main` branch is up to date.
2. Run the script. If there's a reason to, you can pass in a different SHA as a CLI argument.
3. 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`, `v1`, and `v2` have been updated.
3. 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`, `v2`, and `v3` have been updated.

Note that any updates to checks need to be backported to the `releases/v2` branch, in order to maintain the same set of names for required checks.

## Deprecating a CodeQL version (write access required)

Expand Down Expand Up @@ -111,8 +113,8 @@ To deprecate an older version of the Action:
- Add a changelog note announcing the deprecation.
- 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 [release-branches.py](.github/actions/release-branches/release-branches.py). Once this PR is merged, the release process will no longer backport changes to the deprecated release version.
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.

## Resources

Expand Down