Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
id-token: write
attestations: write
Expand Down Expand Up @@ -62,3 +62,41 @@ jobs:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true

create-release:
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The create-release job depends on build-and-publish with needs: 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.

Suggested change
create-release:
create-release:
# Intentionally depend on Docker image build/publish: only create a GitHub
# release if the container image was successfully built and pushed.

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The awk pattern used to extract changelog entries has a potential issue. The pattern /^## \[${VERSION#v}\]/,/^## \[/ will match from the specified version to the NEXT section header starting with ## [, but using sed '$d' to remove the last line assumes the next section header is immediately on the next line. This won't work correctly if there are blank lines between changelog sections (which exist in the current CHANGELOG.md format).

Additionally, if this is the last version in the changelog (no version section after it), the awk range pattern may not work as expected and could include content all the way to the end of the file.

Consider using a more robust approach that explicitly handles the end of a section, or test with the actual CHANGELOG.md format which includes blank lines between sections.

Suggested change
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 uses AI. Check for mistakes.
if [ ! -s release_notes.md ]; then
echo "Release notes not found in CHANGELOG.md, using default message"
echo "## Changes" > release_notes.md
echo "" >> release_notes.md
echo "See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." >> release_notes.md
fi
cat release_notes.md
Comment on lines +82 to +92
Copy link

Copilot AI Jan 25, 2026

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 uses AI. Check for mistakes.

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: release_notes.md
draft: false
prerelease: ${{ contains(steps.version.outputs.version, '-') }}
generate_release_notes: true
Copy link

Copilot AI Jan 25, 2026

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.

Suggested change
generate_release_notes: true

Copilot uses AI. Check for mistakes.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 1 addition & 6 deletions backend/test/integrations/CodeAnalyzer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,7 @@ class profile::unused {
fs.writeFileSync(path.join(testDir, "manifests", "profile", "unused.pp"), unusedManifest);

// Create a file with trailing whitespace for lint testing
const lintTestManifest = `
class profile::lint_test {
# This line has trailing spaces
notify { 'test': }
}
`;
const lintTestManifest = 'class profile::lint_test {\n # This line has trailing spaces \n notify { \'test\': }\n}\n';
fs.writeFileSync(path.join(testDir, "manifests", "profile", "lint_test.pp"), lintTestManifest);

// Create profile::vhost defined type
Expand Down
Loading