File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 7474 export target_branch="${{ github.event.inputs.create_branch_name }}"
7575 echo "Using workflow input as target branch: $target_branch"
7676 echo "target_branch=$target_branch" >> "$GITHUB_OUTPUT"
77- elif [[ "${{ github.event_name }}" == "push" ]]; then
78- export target_branch="${GITHUB_REF#refs/heads /}"
79- echo "Using tag/branch name as target_branch: $target_branch"
77+ elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref_type }}" == "tag" ]]; then
78+ export target_branch="${GITHUB_REF#refs/tags /}"
79+ echo "Using tag name as target_branch: $target_branch"
8080 echo "target_branch=$target_branch" >> "$GITHUB_OUTPUT"
8181 elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
8282 export target_branch="${{ github.event.pull_request.head.ref }}"
@@ -118,10 +118,12 @@ jobs:
118118 git checkout -b ${{ steps.determine_branch.outputs.target_branch }}
119119 git add .
120120 git commit -m "firewood ci ${{ github.sha }}: attach firewood static libs"
121- git push -u origin ${{ steps.determine_branch.outputs.target_branch }} --force
121+
122122 if [[ "${{ github.ref_type }}" == "tag" ]]; then
123123 git tag -a "${GITHUB_REF#refs/tags/}" -m "firewood ci ${{ github.sha }}: attach firewood static libs"
124- git push origin "${GITHUB_REF#refs/tags/}"
124+ git push origin "refs/tags/${GITHUB_REF#refs/tags/}"
125+ else
126+ git push -u origin ${{ steps.determine_branch.outputs.target_branch }} --force
125127 fi
126128
127129 # Check out the branch created in the previous job on a matrix of
You can’t perform that action at this time.
0 commit comments