diff --git a/.github/workflows/crucible-release.yaml b/.github/workflows/crucible-release.yaml index 4129878..35f7c8f 100644 --- a/.github/workflows/crucible-release.yaml +++ b/.github/workflows/crucible-release.yaml @@ -26,7 +26,7 @@ on: # yamllint disable-line rule:truthy force_push: required: false type: boolean - description: FORCE push (override if tag exists) + description: FORCE push (override tag) default: false jobs: @@ -35,7 +35,6 @@ jobs: timeout-minutes: 5 outputs: tag: ${{ steps.gen-release-tag.outputs.tag }} - force: ${{ steps.get-force-push.outputs.force }} steps: - name: Generate release tag id: gen-release-tag @@ -48,14 +47,6 @@ jobs: else echo "tag=${{ inputs.custom_tag }}" >> $GITHUB_OUTPUT fi - - name: Get force push flag - if: ${{ inputs.action == 'push' }} - id: get-force-push - run: | - if [ ${{ inputs.force_push == true }} ]; then - echo "force='-f'" >> $GITHUB_OUTPUT - else - echo "force=''" >> $GITHUB_OUTPUT display-params: runs-on: ubuntu-latest @@ -107,7 +98,6 @@ jobs: if: ${{ inputs.dry_run == false }} env: TAG: ${{ needs.release-tag.outputs.tag }} - FORCE: ${{ needs.release-tag.outputs.force }} run: | cd $GITHUB_WORKSPACE cd crucible @@ -115,7 +105,11 @@ jobs: git ls-remote --tags origin if [ ${{ inputs.action == 'push' }} ]; then git tag $TAG - git push origin $TAG $FORCE + if [ ${{ inputs.force_push == true }} ]; then + git push origin $TAG --force + else + git push origin $TAG + fi elif [ ${{ inputs.action == 'delete' }} ]; then git push --delete origin $TAG fi @@ -187,7 +181,6 @@ jobs: if: ${{ inputs.dry_run == false }} env: TAG: ${{ needs.release-tag.outputs.tag }} - FORCE: ${{ needs.release-tag.outputs.force }} run: | cd $GITHUB_WORKSPACE cd ${{ matrix.repository }} @@ -195,7 +188,11 @@ jobs: git ls-remote --tags origin if [ ${{ inputs.action == 'push' }} ]; then git tag $TAG - git push origin $TAG $FORCE + if [ ${{ inputs.force_push == true }} ]; then + git push origin $TAG --force + else + git push origin $TAG + fi elif [ ${{ inputs.action == 'delete' }} ]; then git push --delete origin $TAG fi