Skip to content

Commit 1d75a7f

Browse files
Fix tag handling for attach static libs (#895)
1 parent a5026e9 commit 1d75a7f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/attach-static-libs.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
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

0 commit comments

Comments
 (0)