Skip to content

Commit

Permalink
fix(ci): fix the tag detection logic for new releases
Browse files Browse the repository at this point in the history
  • Loading branch information
paambaati authored Apr 21, 2023
1 parent ea13673 commit f787a56
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: Get next release version
runs-on: ubuntu-latest
outputs:
git-tag: ${{ steps.git-tag.outputs.git-tag }}
new-release-version: ${{ steps.next-version.outputs.new-release-version }}
last-release-version: ${{ steps.last-release.outputs.release }}
new-release-version: ${{ steps.next-release.outputs.new-release-version }}
steps:
- name: checkout code
uses: actions/checkout@v3
Expand All @@ -27,12 +27,15 @@ jobs:
run: npm ci

- name: find current latest release version
id: git-tag
shell: bash
run: echo "git-tag=`echo $(git describe --tags --abbrev=0 | sed -e 's/^v//')`" >> $GITHUB_OUTPUT
uses: pozetroninc/github-action-get-latest-release@master
id: last-release
with:
owner: paambaati
repo: codeclimate-action
token: ${{ secrets.CUSTOM_GITHUB_PERSONAL_TOKEN }}

- name: find next release version
id: next-version
id: next-release
run: npm_config_yes=true npx semantic-release --dry-run
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_PERSONAL_TOKEN }}
Expand All @@ -41,7 +44,7 @@ jobs:
name: Cut a release on GitHub
runs-on: ubuntu-latest
needs: next-version
if: needs.next-version.outputs.new-release-version == needs.next-version.outputs.git-tag
if: needs.next-version.outputs.new-release-version == needs.next-version.outputs.last-release-version
steps:
- name: checkout code
uses: actions/checkout@v3
Expand Down

0 comments on commit f787a56

Please sign in to comment.