File tree Expand file tree Collapse file tree 1 file changed +25
-12
lines changed
Expand file tree Collapse file tree 1 file changed +25
-12
lines changed Original file line number Diff line number Diff line change 1515permissions :
1616 pull-requests : write
1717 id-token : write # This is required for requesting the JWT
18- contents : read # This is required for actions/checkout
18+ contents : write # This is required for actions/checkout
1919
2020jobs :
2121 tag_renaming_process :
2222 runs-on : ubuntu-latest
23+ permissions : write-all
2324
2425 steps :
25-
26+
2627 - name : Checkout
2728 uses : actions/checkout@v3
2829 with :
29- ref : main
30-
31- - name : Get and create new tag
32- id : init
30+ ref : ${{ github.event.inputs.old_tag }}
31+ fetch-depth : 0
32+
33+ - name : Check SHA
34+ id : get-sha
3335 run : |
34- git checkout ${{ github.event.inputs.old_tag}}
35- git tag ${{ github.event.inputs.new_tag}}
36- git push origin ${{ github.event.inputs.new_tag}}
37-
38- working-directory : ./
39- shell : bash
36+ echo "BRANCH_SHA=$(git log -1 '--format=format:%H')">> $GITHUB_OUTPUT
37+
38+ - name : Check SHA value
39+ run : |
40+ echo Branch SHA: ${{steps.get-sha.outputs.BRANCH_SHA}}
41+
42+ - name : Create tag
43+ uses : actions/github-script@v7
44+ with :
45+ script : |
46+ console.log(context)
47+ github.rest.git.createRef({
48+ owner: context.repo.owner,
49+ repo: context.repo.repo,
50+ ref: 'refs/tags/${{github.event.inputs.new_tag}}',
51+ sha:'${{steps.get-sha.outputs.BRANCH_SHA}}'
52+ })
You can’t perform that action at this time.
0 commit comments