markdownlint readme #40
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: "go-licenses" | |
on: | |
push: | |
paths: | |
- 'go.mod' | |
branches: | |
- master | |
- v1 | |
- v2 | |
workflow_dispatch: | |
jobs: | |
go-licenses: | |
runs-on: ubuntu-latest | |
name: Run go-licenses | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Get google/go-licenses package | |
run: go install github.com/google/go-licenses@latest | |
shell: bash | |
- name: Run go-licenses and save deps | |
run: | | |
go-licenses save ./... --save_path=dependencies --force | |
go-licenses check ./... --disallowed_types="forbidden,restricted" | |
- name: Push licenses | |
run: | | |
git config --global user.name "${{ vars.CI_COMMIT_AUTHOR }}" | |
git config --global user.email "${{ vars.CI_COMMIT_EMAIL }}" | |
git add dependencies | |
git diff --quiet --exit-code --cached dependencies && exit 0 | |
git commit -m "ci(licenses): updated licenses" | |
git push |