5757 - name : Update bundle
5858 uses : ./.github/actions/update-bundle
5959
60+ - name : Bump action minor version for new CodeQL minor version series
61+ id : bump-action-version
62+ run : |
63+ cli_version=$(jq -r '.cliVersion' src/defaults.json)
64+ # Check if this is a new minor version series (patch version is 0)
65+ if [[ "$cli_version" =~ ^[0-9]+\.[0-9]+\.0$ ]]; then
66+ echo "New CodeQL minor version series detected ($cli_version), bumping action minor version"
67+ npm version minor --no-git-tag-version
68+ echo "bumped=true" >> "$GITHUB_OUTPUT"
69+ else
70+ echo "Not a new minor version series ($cli_version), skipping action version bump"
71+ echo "bumped=false" >> "$GITHUB_OUTPUT"
72+ fi
73+
6074 - name : Rebuild Action
6175 run : npm run build
6276
@@ -71,11 +85,21 @@ jobs:
7185 - name : Open pull request
7286 env :
7387 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88+ ACTION_VERSION_BUMPED : ${{ steps.bump-action-version.outputs.bumped }}
7489 run : |
7590 cli_version=$(jq -r '.cliVersion' src/defaults.json)
91+ action_version=$(jq -r '.version' package.json)
92+
93+ pr_body="This pull request updates the default CodeQL bundle, as used with \`tools: linked\` and on GHES, to $cli_version."
94+ if [[ "$ACTION_VERSION_BUMPED" == "true" ]]; then
95+ pr_body="$pr_body
96+
97+ Since this is a new CodeQL minor version series, this PR also bumps the Action version to $action_version."
98+ fi
99+
76100 pr_url=$(gh pr create \
77101 --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. " \
102+ --body "$pr_body " \
79103 --assignee "$GITHUB_ACTOR" \
80104 --draft \
81105 )
0 commit comments