11name : Deploy Homebrew Tap
22
33on :
4+ # Test formula on PRs (audit only, don't deploy)
5+ pull_request :
6+ branches : [ master ]
7+ paths :
8+ - ' packaging/homebrew/mfc.rb'
9+ - ' packaging/homebrew/README.md'
10+ # Deploy to tap on push to master
411 push :
512 branches : [ master, homebrew-new ]
613 paths :
714 - ' packaging/homebrew/mfc.rb'
815 - ' packaging/homebrew/README.md'
916 tags :
1017 - ' v*.*.*'
18+ # Allow manual trigger for testing
1119 workflow_dispatch :
1220
1321permissions :
1422 contents : read
1523
1624jobs :
1725 deploy-tap :
18- name : Sync/bump formula in tap
26+ name : Audit and deploy formula
1927 runs-on : macos-14
2028 permissions :
2129 contents : write
4149 echo "version=${VERSION}" >> $GITHUB_OUTPUT
4250 echo "url=${URL}" >> $GITHUB_OUTPUT
4351 echo "sha256=${SHASUM}" >> $GITHUB_OUTPUT
52+ echo "Event: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
53+ echo "Version: ${VERSION}" >> $GITHUB_STEP_SUMMARY
54+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
55+ echo "Mode: Audit only (PR)" >> $GITHUB_STEP_SUMMARY
56+ else
57+ echo "Mode: Audit and deploy" >> $GITHUB_STEP_SUMMARY
58+ fi
4459
4560 - name : Update formula (for tag events)
4661 if : github.ref_type == 'tag'
6176 brew untap mfc/local
6277
6378 - name : Clone or bootstrap tap repository
79+ if : github.event_name != 'pull_request'
6480 env :
6581 TAP_TOKEN : ${{ secrets.TAP_REPO_TOKEN }}
6682 run : |
@@ -81,12 +97,14 @@ jobs:
8197 fi
8298
8399 - name : Copy formula and README into tap
100+ if : github.event_name != 'pull_request'
84101 run : |
85102 mkdir -p tap-repo/Formula
86103 cp packaging/homebrew/mfc.rb tap-repo/Formula/mfc.rb
87104 cp packaging/homebrew/README.md tap-repo/README.md
88105
89106 - name : Commit & push if changed
107+ if : github.event_name != 'pull_request'
90108 env :
91109 TAP_TOKEN : ${{ secrets.TAP_REPO_TOKEN }}
92110 run : |
0 commit comments