Skip to content

Commit

Permalink
ci: Change trigger for publishing to only check commit message content
Browse files Browse the repository at this point in the history
  • Loading branch information
IanTapply22 committed May 25, 2024
1 parent f83beba commit c1801d9
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- run: 'echo version ${{ steps.version.outputs.version }}'

publish:
if: ${{ startsWith(github.event.head_commit.message, 'feat') }}
needs: version
runs-on: ubuntu-latest
permissions:
Expand All @@ -33,17 +34,6 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Check version change
id: check_version_update
run: |
previous_version=$(git show HEAD^:build.gradle | grep -oP '(version\s*")\K[^"]+' | head -n1)
current_version=$(grep -oP '(version\s*")\K[^"]+' build.gradle | head -n1)
if [ "$previous_version" != "$current_version" ]; then
echo "::set-output name=version_changed::true"
else
echo "::set-output name=version_changed::false"
fi
- name: Publish package
if: steps.check_version_update.outputs.version_changed == 'true'
run: ./gradlew publish
Expand Down

0 comments on commit c1801d9

Please sign in to comment.