Skip to content

Commit

Permalink
fix(semantic-release): run git fetch before getting tags
Browse files Browse the repository at this point in the history
- removes errors when actions/checkout is run without fetch-depth: 0
  • Loading branch information
EdieLemoine committed Sep 19, 2022
1 parent 90b7b0c commit 68c5bd7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions semantic-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ runs:
with:
token: ${{ inputs.token }}

- run: |
- name: 'Fetch tags'
run: |
git fetch --tags
shell: bash

- name: 'Get previous version'
run: |
tag=$(git describe --tags --abbrev=0)
echo "::set-output name=previous-version::${tag}"
id: previous-version
Expand All @@ -38,13 +44,15 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.token }}

- run: |
- name: 'Get new version'
run: |
tag=$(git describe --tags --abbrev=0)
echo "::set-output name=version::${tag}"
id: version
shell: bash

- run: |
- name: 'Update outputs'
run: |
if [ "${{ steps.previous-version.outputs.previous-version }}" == "${{ steps.version.outputs.version }}" ]; then
echo "::set-output name=released::false"
echo "::set-output name=version::"
Expand Down

0 comments on commit 68c5bd7

Please sign in to comment.