From be6a9dbd9f3e5421601924304f864589ce3df70f Mon Sep 17 00:00:00 2001 From: Ethan Holz Date: Thu, 28 Sep 2023 14:32:17 -0500 Subject: [PATCH] ci: added go-licenses --- .github/workflows/go-licenses.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/go-licenses.yml diff --git a/.github/workflows/go-licenses.yml b/.github/workflows/go-licenses.yml new file mode 100644 index 0000000..235c9c3 --- /dev/null +++ b/.github/workflows/go-licenses.yml @@ -0,0 +1,30 @@ +name: "go-licenses" +on: + push: + paths: + - 'go.mod' + branches: + - master + +jobs: + go-licenses: + runs-on: ubuntu-latest + name: Run go-licenses + steps: + - uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '>=1.21' + - 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 + - name: Push licenses + run: | + git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" + git config --global user.email "${{ env.CI_COMMIT_EMAIL }}" + git add dependencies + git commit -m "ci(licenses): updated licenses" + git push