From 691c7aced9d4b0e030fd95d03e0b0647ca553e4c Mon Sep 17 00:00:00 2001 From: Pratham Dubey <134331217+prathamdby@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:48:50 +0530 Subject: [PATCH] Migrate to the Git Commit Push Action step in the Add License workflow --- .github/workflows/add-license.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/add-license.yml b/.github/workflows/add-license.yml index cae78b9..8747cb9 100644 --- a/.github/workflows/add-license.yml +++ b/.github/workflows/add-license.yml @@ -13,30 +13,18 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Required to retrieve full commit history + persist-credentials: false # Required to allow the use of the token to push back to the repository - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.10" - name: Add License run: | python scripts/add_license.py - - name: Check for file changes - id: changes - run: | - if [ -n "$(git status --porcelain)" ]; then - echo "::set-output name=changes::true" - else - echo "::set-output name=changes::false" - fi - - - name: Commit changes - if: steps.changes.outputs.changes == true - run: | - git config --global user.name "GitHub Actions Bot" - git config --global user.email "actions@github.com" - git add . - git commit -m "Add license to files" - git push + - uses: GuillaumeFalourd/git-commit-push@v1.3 + with: + commit_message: "Add license to files" + target_branch: main