Skip to content

Commit

Permalink
Merge pull request #38 from storyprotocol/fix/workflow_permission
Browse files Browse the repository at this point in the history
[fix] workflow permission
  • Loading branch information
AndyBoWu authored Apr 26, 2024
2 parents 104a0bf + 1185d9c commit 0186d79
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/reusable-create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:

permissions:
contents: write

actions: write

jobs:
release:
# if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -19,19 +20,30 @@ jobs:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Retrieve Previous Tag Before Creating New Tag
id: get_previous_tag
run: |
git fetch --tags
# Get the last tag from the list of tags sorted by creation date
LATEST_TAG=$(git tag --sort=creatordate | tail -n1)
echo "The latest tag based on creation date is $LATEST_TAG"
echo "fromTag=$LATEST_TAG" >> $GITHUB_ENV
- name: Tag and Push
id: tag_and_push
run: |
VERSION=${{ inputs.version_to_publish }}
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git tag -a v$VERSION -m "Release v$VERSION"
git push origin v$VERSION
echo "toTag=v$VERSION" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@32e3c96f29a6532607f638797455e9e98cfc703d #v4
uses: mikepenz/release-changelog-builder-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit 0186d79

Please sign in to comment.