Skip to content

Commit

Permalink
Update create_release_commit.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreQuebriac authored Oct 12, 2023
1 parent a824ad1 commit 0b9ea64
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions .github/workflows/create_release_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,23 @@ jobs:
--field encoding="base64" \
--field branch="master" \
--field sha="$SHA"
- name: Create Tag
working-directory: ${{github.workspace}}
run: |
echo "Create Tag"
TAG_SHA=$(gh api --method POST /repos/:owner/:repo/git/tags \
--field tag="${{inputs.version_name}}" \
--field message="$CI_COMMIT_MESSAGE" \
--field type="commit" \
--field object="${{env.SHA}}" \
--jq '.sha')
echo "TAG_SHA=$TAG_SHA" >> $GITHUB_ENV
echo $TAG_SHA
- name: Create Tag Ref
working-directory: ${{github.workspace}}
run: |
echo "Create Tag ref"
git fetch --all --tags
gh api --method POST -H "Accept: application/vnd.github+json" \
RESP=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}} " \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/3LawsRobotics/3laws/git/tags \
-d '{"tag":"${{inputs.version_name}}","message":"$CI_COMMIT_MESSAGE","object":"$SHA","type":"commit"}')
echo $RESP
SHA=$(echo $RESP | jq -r '.sha')
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}} " \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/:owner/:repo/git/refs \
--field ref="refs/tags/${{inputs.version_name}}" \
--field sha="$TAG_SHA"
https://api.github.com/repos/3LawsRobotics/3laws/git/refs \
-d '{"ref":"refs/tags/${{inputs.version_name}}","sha":"$SHA"}'

0 comments on commit 0b9ea64

Please sign in to comment.