Skip to content

Commit

Permalink
feat(ci): Add license workflow (#5465)
Browse files Browse the repository at this point in the history
* add license workflow

* add api key

* update name of workflow

* add new line

* change workflow to run at midnight

* simplify task
  • Loading branch information
sakoush committed Mar 21, 2024
1 parent 74893d4 commit 7f3bd11
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: V2 Licenses

on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
licenses:
runs-on: ubuntu-latest
if: github.repository == 'SeldonIO/seldon-core' # Do not run this on forks.
steps:
- name: Get github access token
run: |
echo ${{ secrets.GH_API_TOKEN }} > ~/.github_api_token
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
- name: Install Dependencies
run: |
make install-go-license-tools
- name: Generate Licenses
run: |
make update-3rd-party-licenses
git --no-pager diff --name-only --exit-code
- name: Open PR with License Changes
if: ${{ failure() }}
uses: peter-evans/create-pull-request@v6
with:
commit-message: Re-generate license info
branch: licenses/license-change
branch-suffix: timestamp
delete-branch: true
title: Re-generate License Info
body: "
# License Change Detected :warning:\n
Most likely, this has been triggered due to a licensing change in
one of our subdependencies, or the introduction of a new
subdependency.
This automated PR will re-generate the licenses to keep them up to
date."
reviewers: sakoush, lc525

0 comments on commit 7f3bd11

Please sign in to comment.