Merge pull request #290 from Bedrock-OSS/update-export-targets #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: List Credits | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "go.mod" | |
permissions: | |
contents: write | |
jobs: | |
list-credits: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Generate CREDITS file using go-licenses | |
run: | | |
go install github.com/google/go-licenses@latest | |
go-licenses report github.com/Bedrock-OSS/regolith > CREDITS.csv | |
- name: Commit the licenses (if there are any changes) | |
run: | | |
if $(git diff --quiet --ignore-blank-lines -w); then | |
echo "No changes to commit" | |
else | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "Generated CREDITS.csv" | |
git push | |
fi |