mirror of
https://github.com/erlef/setup-beam.git
synced 2026-08-01 03:26:08 +00:00
Fix 3rd party license updater (#92)
Instead of pushing directly (since the main branch is protected) this creates a pull request
This commit is contained in:
committed by
GitHub
parent
6c5caca0fb
commit
df03a946e0
@@ -4,10 +4,25 @@ set -eux
|
|||||||
|
|
||||||
git config user.name "GitHub Actions"
|
git config user.name "GitHub Actions"
|
||||||
git config user.email "actions@user.noreply.github.com"
|
git config user.email "actions@user.noreply.github.com"
|
||||||
git checkout main
|
|
||||||
|
|
||||||
|
BRANCH=feature/3rd-party-licenses-update
|
||||||
|
|
||||||
|
if git branch -a | grep "$BRANCH" > /dev/null; then
|
||||||
|
# already exists
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
git fetch origin
|
||||||
|
git checkout -b "$BRANCH"
|
||||||
npm run licenses
|
npm run licenses
|
||||||
|
|
||||||
git add 3RD_PARTY_LICENSES
|
if ! git diff --exit-code 1> /dev/null ; then
|
||||||
git commit -m "Update 3rd party licenses" || true
|
# there's stuff to push
|
||||||
git push origin
|
git add 3RD_PARTY_LICENSES
|
||||||
|
git commit -m "Update 3rd party licenses"
|
||||||
|
git push origin "$BRANCH"
|
||||||
|
|
||||||
|
gh pr create --fill \
|
||||||
|
--title "Update 3rd party licenses (automation)" \
|
||||||
|
--body "This is an automated action to update the action's 3rd party licenses"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ jobs:
|
|||||||
node-version: '14'
|
node-version: '14'
|
||||||
- run:
|
- run:
|
||||||
./.github/workflows/update_3rd_party_licenses.sh
|
./.github/workflows/update_3rd_party_licenses.sh
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|||||||
Reference in New Issue
Block a user