@@ -53,11 +53,18 @@ jobs:
5353 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
5454 run : cargo publish --no-verify
5555
56- # 3. Update Homebrew tap with new SHAs .
56+ # 3. Update Homebrew formula in this repo (it doubles as the tap) .
5757 homebrew :
5858 runs-on : ubuntu-latest
5959 needs : build
60+ permissions :
61+ contents : write
6062 steps :
63+ - uses : actions/checkout@v4
64+ with :
65+ ref : main
66+ token : ${{ secrets.GITHUB_TOKEN }}
67+
6168 - name : Resolve tag
6269 id : tag
6370 run : echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
@@ -73,22 +80,15 @@ jobs:
7380 echo "${t}=${sha}" >> "$GITHUB_OUTPUT"
7481 done
7582
76- - name : Checkout tap repo
77- uses : actions/checkout@v4
78- with :
79- repository : dudegladiator/homebrew-tap
80- token : ${{ secrets.TAP_REPO_TOKEN }}
81- path : tap
82-
8383 - name : Write formula
8484 env :
8585 VERSION : ${{ steps.tag.outputs.version }}
8686 SHA_ARM : ${{ steps.sha.outputs.aarch64-apple-darwin }}
8787 SHA_INTEL : ${{ steps.sha.outputs.x86_64-apple-darwin }}
8888 SHA_LINUX : ${{ steps.sha.outputs.x86_64-unknown-linux-gnu }}
8989 run : |
90- mkdir -p tap/ Formula
91- cat > tap/ Formula/cc-session.rb <<EOF
90+ mkdir -p Formula
91+ cat > Formula/cc-session.rb <<EOF
9292 class CcSession < Formula
9393 desc "Interactive TUI editor for Claude Code session JSONL files"
9494 homepage "https://github.com/dudegladiator/claude-code-session-editor"
@@ -121,8 +121,7 @@ jobs:
121121 end
122122 EOF
123123
124- - name : Commit + push tap
125- working-directory : tap
124+ - name : Commit + push formula
126125 env :
127126 VERSION : ${{ steps.tag.outputs.version }}
128127 run : |
@@ -133,5 +132,5 @@ jobs:
133132 echo "no formula changes"
134133 exit 0
135134 fi
136- git commit -m "cc-session ${VERSION}"
137- git push
135+ git commit -m "chore: update Homebrew formula for v ${VERSION}"
136+ git push origin HEAD:main
0 commit comments