build: fix labsdk pypa gha #358
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: Licenses Check | |
on: | |
push: ~ | |
pull_request: | |
types: [ opened, synchronize ] | |
jobs: | |
licenses: | |
name: Check valid licenses | |
runs-on: ubuntu-latest | |
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
steps: | |
- name: Setup Go environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '^1.22' | |
- name: Clone the code | |
uses: actions/checkout@v4 | |
- name: Install google/go-licenses | |
run: go install github.com/google/go-licenses@master | |
shell: bash | |
- name: Generate necessary files | |
run: make generate | |
shell: bash | |
- name: Check for allowed licenses | |
run: ./hack/licenses-check-allowed.sh | |
shell: bash | |
- name: Check for license header | |
env: | |
GITHUB: true | |
run: ./hack/check-headers-for-license.sh | |
shell: bash | |
- name: Report failure | |
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
uses: actions-cool/issues-helper@v3 | |
with: | |
actions: 'create-issue' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
title: 🛑 Licences issue for ${{ github.sha }} | |
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
labels: bug |