Skip to content

Generate NOTICE.MD workflow #26

Generate NOTICE.MD workflow

Generate NOTICE.MD workflow #26

Workflow file for this run

name: Generate NOTICE.MD
on:
push:
workflow_dispatch:
jobs:
generate-notice-file:
strategy:
matrix:
module: [ "quesma" ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
cache-dependency-path: ${{ matrix.module }}/go.sum
go-version: '1.22'
- name: Install go-licence-detector
working-directory: ${{ matrix.module }}
run: go get go.elastic.co/go-licence-detector && go install go.elastic.co/go-licence-detector
- name: Generate NOTICE.MD
working-directory: ${{ matrix.module }}
run: |
go list -m -json all | go-licence-detector -includeIndirect -noticeTemplate=../.github/templates/NOTICE.txt.tmpl -noticeOut=../NOTICE.MD -depsTemplate=../.github/templates/dependencies.asciidoc.tmpl -depsOut=dependencies.asciidoc
rm dependencies.asciidoc
- name: Print NOTICE.MD
run: cat NOTICE.MD
- name: Issue a Pull Request
run: |
BRANCH_NAME="notice/$(date +%Y%m%d%H%M%S)"
git checkout -b "$BRANCH_NAME"
git config --local user.email "[email protected]"
git config --local user.name "Quesma AI"
git add NOTICE.MD
git commit -m "Update NOTICE.MD"
git push origin HEAD
gh pr create --dry-run --title "Update NOTICE.MD" --body "This PR updates the NOTICE.MD file." --base main --head "$BRANCH_NAME"
env:
GH_TOKEN: ${{ github.token }}