File tree Expand file tree Collapse file tree 9 files changed +44
-20
lines changed
Expand file tree Collapse file tree 9 files changed +44
-20
lines changed Original file line number Diff line number Diff line change 1+ kind : Fixed
2+ body : repo init now validates that the trunk branch is a local branch
3+ time : 2025-07-13T18:46:07.569257-07:00
Original file line number Diff line number Diff line change @@ -15,12 +15,11 @@ jobs:
1515 - uses : actions/checkout@v4
1616 name : Check out repository
1717 - uses : jdx/mise-action@v2
18- env :
19- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
18+ with :
19+ github_token : ${{ secrets.GITHUB_TOKEN }}
2020 - name : Go cache
2121 uses : ./.github/actions/go-cache
22- - run : |
23- mise run generate
22+ - run : mise run generate
2423 - uses : autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
2524 with :
2625 fail-fast : true
Original file line number Diff line number Diff line change 2626 token : ${{ secrets.PAT }} # for push
2727
2828 - uses : jdx/mise-action@v2
29- env :
30- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29+ with :
30+ github_token : ${{ secrets.GITHUB_TOKEN }}
3131 - run : changie merge
3232
3333 - name : Push changes
Original file line number Diff line number Diff line change 2020 - uses : actions/checkout@v4
2121 name : Check out repository
2222 - uses : jdx/mise-action@v2
23- env :
24- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
23+ with :
24+ github_token : ${{ secrets.GITHUB_TOKEN }}
2525 - run : mise run lint
2626
2727 test-matrix :
3131 - uses : actions/checkout@v4
3232 name : Check out repository
3333 - uses : jdx/mise-action@v2
34- env :
35- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34+ with :
35+ github_token : ${{ secrets.GITHUB_TOKEN }}
3636 - name : Go cache
3737 uses : ./.github/actions/go-cache
3838 - name : Generate test matrix
6464 steps :
6565 - uses : actions/checkout@v4
6666 - uses : jdx/mise-action@v2
67- env :
68- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67+ with :
68+ github_token : ${{ secrets.GITHUB_TOKEN }}
6969 - name : Go cache
7070 uses : ./.github/actions/go-cache
7171
Original file line number Diff line number Diff line change 2727 - uses : jdx/mise-action@v2
2828 with :
2929 working_directory : doc
30- env :
31- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30+ github_token : ${{ secrets.GITHUB_TOKEN }}
3231
3332 - name : Build
3433 run : mise run doc:build --verbose
Original file line number Diff line number Diff line change 2323 uses : actions/checkout@v4
2424
2525 - uses : jdx/mise-action@v2
26- env :
27- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26+ with :
27+ github_token : ${{ secrets.GITHUB_TOKEN }}
2828 - id : run
2929 run : |
3030 mise run release:prepare ${{ inputs.version }}
Original file line number Diff line number Diff line change 2828 token : ${{ secrets.PAT }}
2929
3030 - uses : jdx/mise-action@v2
31- env :
32- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31+ with :
32+ github_token : ${{ secrets.GITHUB_TOKEN }}
3333
3434 - name : Set version (changie)
3535 if : inputs.version == ''
8686 ref : ${{ inputs.ref }}
8787
8888 - uses : jdx/mise-action@v2
89- env :
90- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89+ with :
90+ github_token : ${{ secrets.GITHUB_TOKEN }}
9191
9292 - name : Set version (changie)
9393 if : inputs.version == ''
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ func (cmd *repoInitCmd) Run(
104104 if err != nil {
105105 return fmt .Errorf ("guess trunk: %w" , err )
106106 }
107+ } else if ! repo .BranchExists (ctx , cmd .Trunk ) {
108+ // User-provided trunk must be a local branch.
109+ log .Errorf ("Are you sure %v is a local branch?" , cmd .Trunk )
110+ return fmt .Errorf ("not a branch: %v" , cmd .Trunk )
107111 }
108112 must .NotBeBlankf (cmd .Trunk , "trunk branch must have been set" )
109113
Original file line number Diff line number Diff line change 1+ # 'repo init' should fail when --trunk is a remote ref like origin/main
2+
3+ as 'Test <test@example.com>'
4+ at '2025-07-14T12:00:00Z'
5+
6+ # Set up a repository with a shamhub remote
7+ mkdir repo
8+ cd repo
9+ git init -b main
10+ git commit --allow-empty -m 'Initial commit'
11+
12+ shamhub init
13+ shamhub new origin alice/example.git
14+ git push origin main
15+
16+ # Try to initialize with a remote ref as trunk - should fail
17+ ! gs repo init --trunk origin/main
18+ stderr 'Are you sure origin/main is a local branch?'
19+ stderr 'not a branch: origin/main'
You can’t perform that action at this time.
0 commit comments