Skip to content

Commit

Permalink
Update GitHub workflow to add rector validations
Browse files Browse the repository at this point in the history
The GitHub workflow script has been modified to check for the successful execution of the 'rector' step before proceeding to subsequent actions. It ensures that new tags and releases are not created unless the 'rector' step is successful, therefore enhancing the integrity of the release process.
  • Loading branch information
MarjovanLier committed Jan 9, 2024
1 parent 43604ee commit ee45289
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
- name: Install dependencies
id: composer-install
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run parallel linting
Expand Down Expand Up @@ -84,12 +83,12 @@ jobs:

- name: Get latest tag
id: latest-tag
if: steps.fetch-tags.outcome == 'success'
if: steps.fetch-tags.outcome == 'success' && steps.rector.outcome == 'success'
run: echo ::set-output name=tag::$(git tag | sort -V | tail -n1)

- name: Increment the minor version
id: new-tag
if: steps.latest-tag.outputs.tag != ''
if: steps.latest-tag.outputs.tag != '' && steps.rector.outcome == 'success'
run: |
LATEST_TAG=${{ steps.latest-tag.outputs.tag }}
MAJOR=$(echo $LATEST_TAG | cut -d. -f1)
Expand All @@ -101,15 +100,15 @@ jobs:
- name: Create and push new tag
id: push-tag
if: github.ref == 'refs/heads/main' && steps.new-tag.outputs.new_tag != ''
if: github.ref == 'refs/heads/main' && steps.new-tag.outputs.new_tag != '' && steps.rector.outcome == 'success'
run: |
NEW_TAG=${{ steps.new-tag.outputs.new_tag }}
git tag $NEW_TAG
git push origin $NEW_TAG
- name: Create release
id: create_release
if: github.ref == 'refs/heads/main' && steps.push-tag.outcome == 'success'
if: github.ref == 'refs/heads/main' && steps.push-tag.outcome == 'success' && steps.rector.outcome == 'success'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit ee45289

Please sign in to comment.