-
Notifications
You must be signed in to change notification settings - Fork 451
Bump the Action minor version number on new CodeQL minor version series #3427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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." | ||||||||||
|
||||||||||
| pr_body="$pr_body | |
| Since this is a new CodeQL minor version series, this PR also bumps the Action version to $action_version." | |
| pr_body="$pr_body"$'\n\n'"Since this is a new CodeQL minor version series, this PR also bumps the Action version to $action_version." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: This is a bit horrible. Perhaps in a follow-up, see if you can make this nicer
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic breaks if we ever need to skip a
.0CLI release and go straight to.1or higher. I think ideally we'd extract the minor CLI version fromsrc/defaults.jsonbefore the./.github/actions/update-bundlestep and then compare it to the one here. Not urgent, so feel free to do that in a follow-up PR.