From 3358006cc4cb1e69bb788e3eb4e9697ef889127d Mon Sep 17 00:00:00 2001 From: Giorgio Torres Date: Thu, 15 Feb 2024 12:13:16 +0100 Subject: [PATCH] Adds git auto commit and push action plugin --- .github/workflows/cd.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b508004..3d5211d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -83,6 +83,10 @@ jobs: update_version: runs-on: ubuntu-20.04 needs: check_package + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -95,17 +99,11 @@ jobs: otp-version: '22.3.4.26' version-type: 'strict' - name: Update README.md and mix.exs - run: | - elixir ./scripts/update_version.exs - git config user.name Lucasbot - git config user.email lucas.primola@gmail.com - if [[ -n $(git diff --stat) ]] - then - git commit -am "Updated README.md and mix.exs to version $(cat version)." - git push origin master - else - echo "No version change" - fi + run: elixir ./scripts/update_version.exs + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Updated README.md and mix.exs to version $(cat version). + publish_package: