Skip to content

Commit

Permalink
fix: changed condition strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsonbrsilva committed Apr 26, 2024
1 parent 21a4f6d commit 736dafc
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/create-pre-release-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
echo "No major change was identified."
exit 0
if: ${{ !needs.get_last_version.outputs.is_breaking_change }}
if: |
always() && !failure() && !cancelled() && ${{ !needs.get_last_version.outputs.is_breaking_change }}
generate_breaking_change_version:
name: Generate breaking change version
Expand All @@ -71,7 +72,8 @@ jobs:
with:
commit_message: ${{ github.event.head_commit.message }}
last_version: ${{ needs.get_last_version.outputs.last_version }}
if: ${{ needs.check_major_change.outputs.is_major_change == 'true' }}
if: |
always() && !failure() && !cancelled() && ${{ needs.check_major_change.outputs.is_major_change == 'true' }}
generate_first_release_candidate_version:
name: Generate first release candidate version
Expand All @@ -91,7 +93,8 @@ jobs:
head_commit: ${{ github.event.pull_request.head.sha }}
base_commit: ${{ github.event.pull_request.base.sha }}
last_version: ${{ needs.get_last_version.outputs.last_version }}
if: ${{ !needs.check_major_change.outputs.is_major_change }}
if: |
always() && !failure() && !cancelled() && ${{ !needs.check_major_change.outputs.is_major_change }}
increment_release_candidate_version:
name: Increment release candidate version
Expand Down Expand Up @@ -120,7 +123,8 @@ jobs:
echo "The version ${{ needs.get_last_version.outputs.last_version }} does not match a valid release candidate version."
exit 1
if: ${{ needs.get_last_version.outputs.is_release_candidate == 'true' }}
if: |
always() && !failure() && !cancelled() && ${{ needs.get_last_version.outputs.is_release_candidate == 'true' }}
add_release_candidate_version:
name: Add release candidate version
Expand All @@ -141,9 +145,7 @@ jobs:
new_tag=$version-rc-1
echo "version=$new_tag" >> $GITHUB_OUTPUT
echo "New generated version: $new_tag."
if: |
always() &&
${{ !needs.get_last_version.outputs.is_release_candidate }}
if: always() && !failure() && !cancelled()

create_release:
name: Create release
Expand All @@ -165,8 +167,4 @@ jobs:
version: ${{ needs.add_release_candidate_version.outputs.version || needs.increment_release_candidate_version.outputs.version }}
target_commit: ${{ github.event.pull_request.head.sha }}
pre_release: true
if: |
always() &&
((needs.add_release_candidate_version.result == 'success' && needs.increment_release_candidate_version.result == 'skipped') ||
(needs.add_release_candidate_version.result == 'skipped' && needs.increment_release_candidate_version.result == 'success')
)
if: always() && !failure() && !cancelled()

0 comments on commit 736dafc

Please sign in to comment.