Skip to content

Commit 67cff13

Browse files
authored
Merge pull request #301 from github/jm_bye_bye_publish_action
fix: brought back the original script
2 parents f4a5759 + e130b6d commit 67cff13

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
name: Update major tag for release
22
on:
33
release:
4-
types: [released]
4+
types: [published]
55
workflow_dispatch:
66
inputs:
77
TAG_NAME:
88
description: "Tag name that the major tag will point to (e.g. v1.2.3)"
99
required: true
1010
env:
11-
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
11+
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.ref}}
1212
permissions:
1313
contents: write
1414
jobs:
1515
update_tag:
1616
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Update the ${{ env.TAG_NAME }} tag
20-
uses: actions/publish-action@8a4b4f687b72f481b8a241ef71f38857239698fc
21-
with:
22-
source-tag: ${{ env.TAG_NAME }}
23-
token: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Checkout Repo
20+
uses: actions/[email protected]
21+
- name: version
22+
id: version
23+
run: |
24+
tag=${TAG_NAME/refs\/tags\//}
25+
version=${tag#v}
26+
major=${version%%.*}
27+
{ echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}"; } >> "$GITHUB_OUTPUT"
28+
- name: force update major tag
29+
run: |
30+
git tag v${{ steps.version.outputs.major }}
31+
git push origin refs/tags/v${{ steps.version.outputs.major }} -f

0 commit comments

Comments
 (0)