Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
name: Third Party Licenses
|
|
on:
|
|
push:
|
|
branches:
|
|
- trunk
|
|
paths:
|
|
- .github/licenses.tmpl
|
|
- .github/workflows/third-party-licenses.yml
|
|
- go.mod
|
|
- go.sum
|
|
- script/licenses*
|
|
jobs:
|
|
# This job is responsible for updating the third-party license reports and source code.
|
|
# It should be safe to cancel as the latest version of `go.mod` should be checked in.
|
|
regenerate-licenses:
|
|
runs-on: ubuntu-latest
|
|
concurrency:
|
|
group: ${{ github.workflow }}
|
|
cancel-in-progress: true
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: trunk
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Regenerate licenses
|
|
run: |
|
|
export GOROOT=$(go env GOROOT)
|
|
export PATH=${GOROOT}/bin:$PATH
|
|
go install github.com/google/go-licenses@5348b744d0983d85713295ea08a20cca1654a45e
|
|
make licenses
|
|
git diff
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
if git diff --exit-code; then
|
|
echo "No third-party license changes to commit"
|
|
else
|
|
git config --local user.name "github-actions[bot]"
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add third-party third-party-licenses.*.md
|
|
git commit -m "Generate licenses - $GITHUB_SHA"
|
|
git pull
|
|
git push origin
|
|
fi
|