Merge pull request #7 from AlmogBaku/master #20
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.21' | |
- 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: 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' | |
repo: raptor-ml/raptor | |
token: ${{ secrets.ACTIONS_PAT }} | |
title: 🛑 Disallowed licence for ${{ github.sha }} | |
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
labels: bug |