forked from python-poetry/poetry-core
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.48 KB
/
update_licenses.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: "Update licenses"
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *" # run once a month
jobs:
update-licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y
- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
- name: Update licenses list
run: |
poetry run python src/poetry/core/spdx/helpers.py
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.POETRY_TOKEN_APP_ID }}
private_key: ${{ secrets.POETRY_TOKEN_APP_KEY }}
- name: Create PR if necessary
uses: peter-evans/create-pull-request@v5
with:
token: ${{ steps.generate_token.outputs.token }}
commit-message: "Automated licenses list update"
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
branch: "license-autoupdate"
title: "Automated licenses list update"
body: "Full log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"