Skip to content

Commit cef5872

Browse files
committed
Pipeline updated
1 parent af90460 commit cef5872

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,46 @@ jobs:
115115
env:
116116
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
117117

118+
- name: Update tag if from develop
119+
if: env.BRANCH_NAME == 'develop'
120+
run: |
121+
echo "Updating tag to ${{ env.VERSION }}..."
122+
git tag -f ${{ env.VERSION }} $TAG_COMMIT
123+
git push origin ${{ env.VERSION }} --force
124+
echo "Tag updated to ${{ env.VERSION }}."
125+
126+
- name: Update GitHub Release
127+
if: env.BRANCH_NAME == 'develop'
128+
run: |
129+
echo "Updating GitHub release for tag ${{ env.VERSION }}..."
130+
131+
# Получаем ID релиза по имени тега
132+
RELEASE_ID=$(curl -s \
133+
-H "Authorization: token ${{ secrets.PAT }}" \
134+
-H "Accept: application/vnd.github.v3+json" \
135+
"https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME" | jq -r '.id')
136+
137+
if [[ "$RELEASE_ID" == "null" || -z "$RELEASE_ID" ]]; then
138+
echo "Release not found for tag $TAG_NAME."
139+
exit 1
140+
fi
141+
142+
echo "Found release ID: $RELEASE_ID"
143+
144+
# Обновляем релиз с новым именем тега
145+
curl -s \
146+
-X PATCH \
147+
-H "Authorization: token ${{ secrets.PAT }}" \
148+
-H "Accept: application/vnd.github.v3+json" \
149+
-d '{
150+
"tag_name": "'${{ env.VERSION }}'",
151+
"name": "'${{ env.VERSION }}'",
152+
"body": "Release updated to match the new tag."
153+
}' \
154+
"https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID"
155+
156+
echo "GitHub release updated to ${{ env.VERSION }}."
157+
118158
- name: Commit and push changes to develop
119159
if: env.BRANCH_NAME == 'develop'
120160
run: |

0 commit comments

Comments
 (0)