Skip to content

Commit

Permalink
Add GitHub Action for updating license file for dependabot branches (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kathy-t committed May 3, 2022
1 parent 19001e8 commit b39d415
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/update_license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update license file

on:
push:
branches:
- 'dependabot/**'

jobs:
update_license_file:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: npm ci

- name: Install git-secrets
run: npm run install-git-secrets

- name: Update license file
run: npm run license

- name: Push changes if license file changed
run: |
if [ -n "$(git status --porcelain | grep "THIRD-PARTY-LICENSES.csv")" ]; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add THIRD-PARTY-LICENSES.csv
git commit -m "Update license file"
git push
else
echo "There were no changes to THIRD-PARTY-LICENSE.csv"
fi

0 comments on commit b39d415

Please sign in to comment.