5656 run : go test -race ./...
5757
5858 # goreleaser v2 requires private_key to be a FILE PATH, not inline content.
59- # Writes the secret to ~/.ssh/aur_key and sets has_key=true/false .
60- # If AUR_KEY is absent, the AUR publisher is skipped via --skip=aurs.
59+ # This step writes the secret to a temp file and exposes its path .
60+ # If AUR_KEY is absent the AUR publisher is skipped via --skip=aurs.
6161 - name : Setup AUR key
6262 id : aur
6363 env :
6767 mkdir -p ~/.ssh
6868 echo "$AUR_KEY_CONTENT" > ~/.ssh/aur_key
6969 chmod 600 ~/.ssh/aur_key
70- echo "has_key=true" >> "$GITHUB_OUTPUT"
70+ echo "key_path=$HOME/.ssh/aur_key" >> "$GITHUB_OUTPUT"
71+ echo "goreleaser_args=release --clean" >> "$GITHUB_OUTPUT"
7172 else
72- echo "has_key=false" >> "$GITHUB_OUTPUT"
73+ echo "key_path=" >> "$GITHUB_OUTPUT"
74+ echo "goreleaser_args=release --clean --skip=aurs" >> "$GITHUB_OUTPUT"
7375 echo "::warning title=AUR_KEY ausente::Publicação no AUR ignorada. Configure o secret AUR_KEY para habilitar."
7476 fi
7577
@@ -78,14 +80,14 @@ jobs:
7880 with :
7981 distribution : goreleaser
8082 version : " ~> v2"
81- args : >-
82- release --clean
83- ${{ steps.aur.outputs.has_key != 'true' && '--skip=aurs' || '' }}
83+ args : ${{ steps.aur.outputs.goreleaser_args }}
8484 env :
85+ # GitHub token to create the release and upload assets.
86+ # GITHUB_TOKEN is automatically injected by Actions — no extra configuration needed.
8587 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86- # goreleaser v2 expects a file path for private_key, not inline key content .
87- # Points to the file written by the "Setup AUR key" step above .
88- AUR_KEY : /home/runner/.ssh/aur_key
88+ # Path to the SSH private key file written by the "Setup AUR key" step above .
89+ # goreleaser v2 requires a file path here, not inline key content .
90+ AUR_KEY : ${{ steps.aur.outputs.key_path }}
8991
9092 # ── Completion notification ───────────────────────────────────────────────────
9193 notify :
0 commit comments