From 6305dab66dabefc960c7cb0b57c426a07dd98008 Mon Sep 17 00:00:00 2001 From: sahani-deriv <125638269+sahani-deriv@users.noreply.github.com> Date: Fri, 22 Dec 2023 10:50:01 +0800 Subject: [PATCH] ci: fix versioning workflow (#374) * ci: fix versioning workflow * ci: remove test code --- .github/workflows/version.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index 6e2559fb3..1c4a45206 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -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 @@ -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