Skip to content

Commit e3b8227

Browse files
authored
Merge pull request #3427 from github/henrymercer/bump-for-new-minor-series
Bump the Action minor version number on new CodeQL minor version series
2 parents 5e767ef + 8a01181 commit e3b8227

15 files changed

+42
-16
lines changed

.github/workflows/update-bundle.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ jobs:
5757
- name: Update bundle
5858
uses: ./.github/actions/update-bundle
5959

60+
- name: Bump Action minor version if new CodeQL minor version series
61+
id: bump-action-version
62+
run: |
63+
prior_cli_version=$(jq -r '.priorCliVersion' src/defaults.json)
64+
cli_version=$(jq -r '.cliVersion' src/defaults.json)
65+
66+
prior_minor=$(echo "$prior_cli_version" | cut -d. -f2)
67+
current_minor=$(echo "$cli_version" | cut -d. -f2)
68+
69+
if [[ "$current_minor" != "$prior_minor" ]]; then
70+
echo "New CodeQL minor version series ($prior_cli_version -> $cli_version), bumping Action minor version"
71+
npm version minor --no-git-tag-version
72+
echo "bumped=true" >> "$GITHUB_OUTPUT"
73+
else
74+
echo "Same minor version series ($prior_cli_version -> $cli_version), skipping Action version bump"
75+
echo "bumped=false" >> "$GITHUB_OUTPUT"
76+
fi
77+
6078
- name: Rebuild Action
6179
run: npm run build
6280

@@ -71,11 +89,19 @@ jobs:
7189
- name: Open pull request
7290
env:
7391
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
ACTION_VERSION_BUMPED: ${{ steps.bump-action-version.outputs.bumped }}
7493
run: |
7594
cli_version=$(jq -r '.cliVersion' src/defaults.json)
95+
action_version=$(jq -r '.version' package.json)
96+
97+
pr_body="This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version."
98+
if [[ "$ACTION_VERSION_BUMPED" == "true" ]]; then
99+
pr_body+=$'\n\n'"Since this is a new CodeQL minor version series, this PR also bumps the Action version to $action_version."
100+
fi
101+
76102
pr_url=$(gh pr create \
77103
--title "Update default bundle to $cli_version" \
78-
--body "This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version." \
104+
--body "$pr_body" \
79105
--assignee "$GITHUB_ACTOR" \
80106
--draft \
81107
)

lib/analyze-action-post.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action-post.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)