-
Notifications
You must be signed in to change notification settings - Fork 257
ROSAENG-66693 | ci: auto-bump DefaultVersion on master after release #3513
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
base: master
Are you sure you want to change the base?
Changes from all 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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||
| name: Bump DefaultVersion | ||||||
|
|
||||||
| on: | ||||||
| release: | ||||||
| types: [published] | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
|
|
||||||
| jobs: | ||||||
| bump-version: | ||||||
| concurrency: | ||||||
| group: bump-default-version | ||||||
| cancel-in-progress: true | ||||||
| if: "!github.event.release.prerelease" | ||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: write | ||||||
| pull-requests: write | ||||||
| steps: | ||||||
| - name: Checkout master | ||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||
| with: | ||||||
| ref: master | ||||||
|
|
||||||
| - name: Derive and validate release version | ||||||
| id: version | ||||||
| env: | ||||||
| RAW_TAG: ${{ github.event.release.tag_name }} | ||||||
| run: | | ||||||
| set -euo pipefail | ||||||
| VERSION="${RAW_TAG#v}" | ||||||
| if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||||||
| echo "::error::Tag '${RAW_TAG}' is not a stable semver release" | ||||||
| exit 1 | ||||||
| fi | ||||||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||||||
| echo "Bumping DefaultVersion to $VERSION" | ||||||
|
|
||||||
| - name: Update pkg/info/info.go | ||||||
| env: | ||||||
| NEW_VERSION: ${{ steps.version.outputs.version }} | ||||||
| run: | | ||||||
| sed -i "s/^var DefaultVersion = \".*\"/var DefaultVersion = \"${NEW_VERSION}\"/" pkg/info/info.go | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Match the Line 44 searches for Proposed fix- sed -i "s/^var DefaultVersion = \".*\"/var DefaultVersion = \"${NEW_VERSION}\"/" pkg/info/info.go
+ sed -i "s/^const DefaultVersion = \".*\"/const DefaultVersion = \"${NEW_VERSION}\"/" pkg/info/info.go📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| grep 'DefaultVersion' pkg/info/info.go | ||||||
|
|
||||||
| - name: Create PR | ||||||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | ||||||
| with: | ||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| branch: bump-default-version | ||||||
| base: master | ||||||
| title: "OCM-00000 | chore: bump DefaultVersion to ${{ steps.version.outputs.version }}" | ||||||
| body: | | ||||||
| ## DefaultVersion bump | ||||||
|
|
||||||
| Auto-update `DefaultVersion` in `pkg/info/info.go` to `${{ steps.version.outputs.version }}` | ||||||
| after release `${{ github.event.release.tag_name }}`. | ||||||
|
|
||||||
| This keeps the fallback value on master current for local and | ||||||
| non-tagged builds. | ||||||
|
|
||||||
| Auto-generated by GitHub Actions. | ||||||
| commit-message: "OCM-00000 | chore: bump DefaultVersion to ${{ steps.version.outputs.version }}" | ||||||
| labels: chore | ||||||
| delete-branch: true | ||||||
| add-paths: "pkg/info/info.go" | ||||||
| sign-commits: true | ||||||
| signoff: true | ||||||
Uh oh!
There was an error while loading. Please reload this page.