-
Notifications
You must be signed in to change notification settings - Fork 1
ci: Publish on Github on tagging #16
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 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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ jobs: | |||||||||||||
| build-and-publish: | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| permissions: | ||||||||||||||
| contents: read | ||||||||||||||
| contents: write | ||||||||||||||
| packages: write | ||||||||||||||
| id-token: write | ||||||||||||||
| attestations: write | ||||||||||||||
|
|
@@ -62,3 +62,41 @@ jobs: | |||||||||||||
| subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||||||||||||||
| subject-digest: ${{ steps.build.outputs.digest }} | ||||||||||||||
| push-to-registry: true | ||||||||||||||
|
|
||||||||||||||
| create-release: | ||||||||||||||
| needs: build-and-publish | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| permissions: | ||||||||||||||
| contents: write | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout code | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Extract version from tag | ||||||||||||||
| id: version | ||||||||||||||
| run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||||||||||||||
|
|
||||||||||||||
| - name: Extract changelog for version | ||||||||||||||
| id: changelog | ||||||||||||||
| run: | | ||||||||||||||
| VERSION="${{ steps.version.outputs.version }}" | ||||||||||||||
| # Extract the section for this version from CHANGELOG.md | ||||||||||||||
| awk "/^## \[${VERSION#v}\]/,/^## \[/" CHANGELOG.md | sed '$d' > release_notes.md | ||||||||||||||
|
||||||||||||||
| awk "/^## \[${VERSION#v}\]/,/^## \[/" CHANGELOG.md | sed '$d' > release_notes.md | |
| awk -v ver="${VERSION#v}" ' | |
| $0 ~ "^## \\[" ver "\\]" { in_section=1; print; next } | |
| in_section && /^## \[/ { exit } | |
| in_section { print } | |
| ' CHANGELOG.md > release_notes.md |
Copilot
AI
Jan 25, 2026
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.
The changelog extraction step displays the content with cat release_notes.md but doesn't validate that the extraction was successful before proceeding to create the release. If the awk command produces unexpected output or empty content (even passing the -s check due to whitespace), this could create a release with malformed or empty notes.
Consider adding validation to check that the extracted content contains expected sections (e.g., contains "### Added" or "### Changed" markers) before proceeding, or add a step that fails the workflow if extraction produces clearly invalid content.
Copilot
AI
Jan 25, 2026
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.
Setting both body_path with extracted changelog content AND generate_release_notes: true will combine both the extracted changelog and GitHub's auto-generated release notes. This may result in duplicate or confusing information in the release.
If the intention is to use the CHANGELOG.md content as the primary release notes, consider removing generate_release_notes: true. If auto-generated notes are preferred when changelog extraction fails, the logic should be adjusted to conditionally set this parameter based on whether changelog extraction succeeded.
| generate_release_notes: true |
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.
The
create-releasejob depends onbuild-and-publishwithneeds: build-and-publish, which means the release will only be created after the Docker build completes successfully. If the Docker build fails, no release will be created even though the tag was pushed.Consider whether this is the desired behavior. If the goal is to create a GitHub release for every tag push regardless of Docker build status, the jobs should run in parallel without the dependency. Alternatively, if the current behavior is intentional, consider adding a comment explaining this design choice.