From daf6486b86136247e888e5655cc55c95c937911d Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:26:39 +0000 Subject: [PATCH] Update licenses-update.yml (#911) --- .github/workflows/licenses-update.yml | 33 +++++++++++++++++++-------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/licenses-update.yml b/.github/workflows/licenses-update.yml index 991ccafd..03076bfe 100644 --- a/.github/workflows/licenses-update.yml +++ b/.github/workflows/licenses-update.yml @@ -32,17 +32,30 @@ jobs: run: | mv build/reports/dependency-license/index.json src/main/resources/static/3rdPartyLicenses.json - - name: Check for Changes - id: git-check + - name: Set up git config + run: | + git config --global user.email "GitHub Action " + git config --global user.name "GitHub Action " + + - name: Run git add run: | git add src/main/resources/static/3rdPartyLicenses.json - git diff --staged --exit-code || echo "changes=true" >> $GITHUB_ENV + git diff --staged --quiet || echo "changes detected" - - name: Commit and Push Changes - if: env.changes == 'true' - run: | - git config --global user.name 'Stirling-PDF-Bot' - git config --global user.email 'Stirling-PDF-Bot@stirlingtools.com' - git commit -m "Update 3rd Party Licenses" - git push + - name: Create Pull Request + if: env.CHANGES_DETECTED == 'true' + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Update 3rd Party Licenses" + committer: GitHub Action + author: GitHub Action + signoff: true + branch: update-3rd-party-licenses + title: "Update 3rd Party Licenses" + body: | + Auto-generated by [create-pull-request][1] + [1]: https://github.com/peter-evans/create-pull-request + draft: false + delete-branch: true