-
-
Notifications
You must be signed in to change notification settings - Fork 70
ci: modernize GoReleaser config and GitHub Actions workflows #1607
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d4530bc
refactor: modernize ci/cd pipelines and apply minor code updates
nicholas-fedor 10b721f
ci(publish-docs): add required permissions to publish-docs workflow
nicholas-fedor a8f3e8f
ci(release-nightly): add contents read permission for code checkout
nicholas-fedor dd89e14
chore: improve synology-stop with URL validation and HTTPS-aware cookies
nicholas-fedor 22d5063
chore(synology-stop): strengthen URL validation with scheme normaliza…
nicholas-fedor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: "Clean GH Actions Cache" | ||
| description: "Remove GH Actions cache entries for closed branches." | ||
|
|
||
| inputs: | ||
| gh-token: | ||
| description: "GitHub token for API access" | ||
| required: true | ||
| gh-repo: | ||
| description: "GitHub repository in owner/repo format" | ||
| required: true | ||
| branch: | ||
| description: "Target branch" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Clean Cache | ||
| shell: bash | ||
| env: | ||
| # https://cli.github.com/manual/gh_help_environment | ||
| GH_TOKEN: ${{ inputs.gh-token }} | ||
| GH_REPO: ${{ inputs.gh-repo }} | ||
| BRANCH: ${{ inputs.branch }} | ||
| run: | | ||
| # Setting this to not fail the workflow while listing/deleting cache entries. | ||
| set +e | ||
|
|
||
| # Get cache IDs for target branch | ||
| echo "Fetching list of cache IDs for $BRANCH" | ||
| cacheIDs=$(gh cache list --ref "$BRANCH" --json id --jq '.[].id') | ||
|
|
||
| # Delete the cache entries | ||
| if [ -z "$cacheIDs" ]; then | ||
| echo "No cache entries found for $BRANCH" | ||
| else | ||
| echo "Deleting caches..." | ||
| fi | ||
| for cacheID in $cacheIDs | ||
| do | ||
| gh cache delete "$cacheID" | ||
| done | ||
| echo "Done" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: nicholas-fedor/watchtower
Length of output: 2491
🏁 Script executed:
Repository: nicholas-fedor/watchtower
Length of output: 1645
🏁 Script executed:
rg -n 'sbom' build/goreleaser/stable.yaml -A 10 -B 2Repository: nicholas-fedor/watchtower
Length of output: 733
🌐 Web query:
GoReleaser SBOM default output naming format files💡 Result:
GoReleaser SBOMs default output filename templates (written into dist) are configured via the sboms[].documents option. 1) Default sbom id - The default SBOM config id is “default” when sboms[].id is omitted. [1] 2) Default documents (filenames) depending on sboms[].artifacts - If artifacts: "binary", default documents is: {{.Binary }}{{.Version }}{{.Os }}_{{.Arch }}.sbom.json [2][1] - If artifacts: "any", there are no default documents (empty list), so no SBOM outputs are produced unless you set sboms[].documents yourself. [2][1] - Otherwise (e.g., artifacts: "archive" or “source”), default documents is: {{.ArtifactName }}.sbom.json [2][1] 3) What the generated files look like in dist - A typical generated SBOM file corresponds to each cataloged artifact filename with a “.sbom.json” suffix. For example, an archive named my-cmd_1.2.3_linux_arm64.tar.gz results in my-cmd_1.2.3_linux_arm64.tar.gz.sbom.json. [3] 4) Note about.json - GoReleaser’s SBOM docs/defaults include the “.sbom.json” suffix (not just “.sbom”), reflecting an update that appended the “.json” to the default SBOM output naming. [2][4]
Citations:
🌐 Web query:
GoReleaser sbom artifacts default name_template💡 Result:
GoReleaser SBOM artifacts: the default SBOM document filename is When binary: {{.Binary }}{{.Version }}{{.Os }}_{{.Arch }}.sbom.json When any: [] Otherwise (e.g., archive/source installers): {{.ArtifactName }}.sbom.json [1] So there is no single “sbom artifacts default name_template” setting; instead GoReleaser uses the SBOM configuration field documents (templates allowed) whose default value depends on whether sbom is run for binaries or for other artifact types [1]. How it works in config - In sboms section, use documents to control SBOM output names/filenames; this is where name templates are applied (e.g. ${artifact}.spdx.json in docs) [1]. - The default documents value is computed as described above, depending on sbom config (binary vs any vs other) [1]. Example override You can override document templates by setting sboms[].documents in.goreleaser.yaml (templates allowed) [1]. For example, the docs show documents: ["${artifact}.spdx.json"] [1].
Citations:
Fix SBOM upload pattern to match GoReleaser's default output format.
Line 125 uses
if-no-files-found: ignore, which allows releases to proceed without SBOM artifacts. Additionally, the glob patterndist/*.sbomwill not match any files—GoReleaser generates SBOMs with.sbom.jsonsuffix by default (e.g.,watchtower_1.2.3_linux_amd64.tar.gz.sbom.json), so the upload silently fails.Suggested patch
- name: Upload Binary SBOMs uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !inputs.DRY_RUN && inputs.BUILD_TYPE == 'stable' }} with: name: ${{ inputs.BUILD_TYPE }}-binary-sboms - path: dist/*.sbom - if-no-files-found: ignore + path: dist/*.sbom* + if-no-files-found: error📝 Committable suggestion
🤖 Prompt for AI Agents