Skip to content

Commit

Permalink
ci: fix versioning workflow (#374)
Browse files Browse the repository at this point in the history
* ci: fix versioning workflow

* ci: remove test code
  • Loading branch information
sahani-deriv authored Dec 22, 2023
1 parent 9b4d06d commit 6305dab
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ on:
jobs:
version_and_tag:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, 'chore(version)')
if: >
github.event.pull_request.merged == true &&
!contains(github.event.pull_request.title, 'chore') &&
!contains(github.event.pull_request.title, 'ci') &&
!contains(github.event.pull_request.title, 'add')
steps:
- name: Git Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down Expand Up @@ -38,13 +42,24 @@ jobs:
run: melos version --all --yes

- name: Push tag
run: git push --tags
id: push-tag
run: |
output=$(git push --tags 2>&1)
if [[ $output == *"Everything up-to-date"* ]]; then
echo "PUSH_OUTPUT=No package updated" >> $GITHUB_OUTPUT
else
echo "PUSH_OUTPUT=Packages updated" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Make the script files executable
if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
run: chmod +x readme.sh
working-directory: ./scripts

- name: Update README.md
if: ${{ contains(steps.push-tag.outputs.PUSH_OUTPUT, 'Packages updated') }}
run: bash readme.sh
working-directory: ./scripts

Expand Down

0 comments on commit 6305dab

Please sign in to comment.