Bump the Action minor version number on new CodeQL minor version series

This commit is contained in:
Henry Mercer
2026-01-26 15:45:24 +00:00
parent 5e767eff5a
commit b748848f27
+25 -1
View File
@@ -57,6 +57,20 @@ jobs:
- name: Update bundle
uses: ./.github/actions/update-bundle
- name: Bump action minor version for new CodeQL minor version series
id: bump-action-version
run: |
cli_version=$(jq -r '.cliVersion' src/defaults.json)
# Check if this is a new minor version series (patch version is 0)
if [[ "$cli_version" =~ ^[0-9]+\.[0-9]+\.0$ ]]; then
echo "New CodeQL minor version series detected ($cli_version), bumping action minor version"
npm version minor --no-git-tag-version
echo "bumped=true" >> "$GITHUB_OUTPUT"
else
echo "Not a new minor version series ($cli_version), skipping action version bump"
echo "bumped=false" >> "$GITHUB_OUTPUT"
fi
- name: Rebuild Action
run: npm run build
@@ -71,11 +85,21 @@ jobs:
- name: Open pull request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTION_VERSION_BUMPED: ${{ steps.bump-action-version.outputs.bumped }}
run: |
cli_version=$(jq -r '.cliVersion' src/defaults.json)
action_version=$(jq -r '.version' package.json)
pr_body="This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version."
if [[ "$ACTION_VERSION_BUMPED" == "true" ]]; then
pr_body="$pr_body
Since this is a new CodeQL minor version series, this PR also bumps the Action version to $action_version."
fi
pr_url=$(gh pr create \
--title "Update default bundle to $cli_version" \
--body "This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version." \
--body "$pr_body" \
--assignee "$GITHUB_ACTOR" \
--draft \
)