@@ -72,18 +72,57 @@ jobs:
7272 AUTHKEY_BASE64 : ${{ secrets.APPLE_API_KEY }}
7373 - name : Install Snapcraft
7474 uses : samuelmeuli/action-snapcraft@v3
75-
75+
76+ - name : Ensure tap fork exists
77+ run : |
78+ gh repo fork stackitcloud/homebrew-tap \
79+ --fork-name homebrew-tap-fork \
80+ --clone=false || true
81+ env :
82+ GH_TOKEN : ${{ secrets.CLI_RELEASE }}
83+
7684 - name : Run GoReleaser
7785 uses :
goreleaser/[email protected] 7886 with :
7987 args : release --clean
8088 env :
8189 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
90+ HOMEBREW_RELEASE_TOKEN : ${{ secrets.CLI_RELEASE }}
8291 GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
8392 GPG_KEY_PATH : ${{ env.GPG_KEY_PATH }}
8493 # nfpm-rpm signing needs this env to be set.
8594 NFPM_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
8695
96+ - name : Create issue tracking upstream Homebrew PR
97+ run : |
98+ # Wait a moment for GitHub's search index to catch up
99+ sleep 5
100+
101+ # Find the open PR authored by your account in the upstream repository
102+ PR_URL=$(gh pr list \
103+ --repo stackitcloud/homebrew-tap \
104+ --author "@me" \
105+ --state open \
106+ --search "${{ github.ref_name }}" \
107+ --limit 1 \
108+ --json url \
109+ --jq '.[0].url')
110+
111+ if [ -n "$PR_URL" ] && [ "$PR_URL" != "null" ]; then
112+ gh issue create \
113+ --repo "${{ github.repository }}" \
114+ --title "Homebrew Cask PR opened for ${{ github.ref_name }}" \
115+ --body "A pull request has been automatically created for release **${{ github.ref_name }}**:
116+
117+ - **PR:** $PR_URL
118+ - **Upstream:** \`stackitcloud/homebrew-tap:main\`
119+ - **Branch:** \`${{ github.ref_name }}\`"
120+ else
121+ echo "Warning: Could not find an open PR in stackitcloud/homebrew-tap matching release ${{ github.ref_name }}."
122+ fi
123+ env :
124+ GH_TOKEN : ${{ secrets.CLI_RELEASE }}
125+
87126 - name : Clean up GPG key file
88127 if : always()
89128 run : |
0 commit comments