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
26 changes: 12 additions & 14 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,13 @@ jobs:
with:
fetch-depth: 0

- name: Delete existing nightly release and tag
- name: Prepare nightly release
run: |
# Delete existing nightly release if it exists
if gh release view nightly >/dev/null 2>&1; then
echo "Deleting existing nightly release"
gh release delete nightly --yes
fi

# Delete existing nightly tag if it exists
if git rev-parse --verify nightly >/dev/null 2>&1; then
echo "Deleting existing nightly tag"
git tag -d nightly
git push origin :refs/tags/nightly 2>/dev/null || true
fi
gh release delete nightly --yes --cleanup-tag || true
gh release create nightly \
--title "Nightly ($(date -u +%Y-%m-%d) - $(git rev-parse --short HEAD))" \
--generate-notes \
--prerelease
Comment on lines +75 to +81

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's read the nightly.yaml workflow file to understand its full structure
cat -n .github/workflows/nightly.yaml

Repository: mcpchecker/kubernetes-extension

Length of output: 4027


Move the "Prepare nightly release" step to run after GoReleaser completes.

The workflow currently creates the nightly tag before running GoReleaser (line 75–81 before line 93–99). If GoReleaser fails, the nightly tag is already pointing to the current commit. The skip gate at lines 54–57 will prevent retries for the same commit, leaving a broken nightly release in place.

Move the "Prepare nightly release" step to after the build succeeds and before artifacts are uploaded so that tag mutations only occur when all build steps have passed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/nightly.yaml around lines 75 - 81, Move the "Prepare
nightly release" step (the job step named "Prepare nightly release") so it runs
after the GoReleaser step completes successfully and before any artifact
upload/publishing steps; this means removing the GH release/tag creation from
its current pre-build position and inserting it immediately after the GoReleaser
step in the job flow so tag creation only occurs when the build step
(GoReleaser) has succeeded and before uploading artifacts or marking the release
as complete.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -101,6 +94,11 @@ jobs:
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --nightly --clean
args: release --snapshot --clean --skip=publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts
run: gh release upload nightly dist/*.zip dist/*.bundle dist/checksums.txt --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 4 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: 2

git:
ignore_tags:
- nightly

builds:
- main: ./cmd
binary: "kubernetes-extension-{{ .Os }}-{{ .Arch }}"
Expand Down Expand Up @@ -35,11 +39,5 @@ signs:
release:
prerelease: auto

nightly:
tag_name: nightly
name_template: "Nightly Release ({{ .Date }} - {{ .ShortCommit }})"
keep_single_release: true
publish_release: true

changelog:
sort: asc