forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 2.25 KB
/
licenses-update.yml
File metadata and controls
61 lines (52 loc) · 2.25 KB
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
53
54
55
56
57
58
59
60
61
name: Licenses Update
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * MON'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with: { ruby-version: '2.6' }
- uses: actions/setup-go@v2
with: { go-version: '1.17' }
# set up correct version of node
- id: nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- uses: actions/setup-node@v2
with: { node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}' }
- name: Install license_finder
run: gem install license_finder:6.9.0 # sync with licenses-check.yml
- name: Generate report
run: ./dev/licenses.sh
- name: Preview report diff
run: git --no-pager diff
- name: Create pull request
uses: peter-evans/create-pull-request@v3 # https://github.com/peter-evans/create-pull-request
id: cpr
with:
labels: automerge
base: main
branch: chore/licenses-update
title: 'chore: update third-party licenses'
commit-message: 'chore: update third-party licenses'
team-reviewers: 'sourcegraph/dev-experience'
body: |
This is an automated pull request generated by [this run](https://github.com/sourcegraph/sourcegraph/actions/runs/${{ github.run_id }}).
Learn more about our GitHub Actions for managing licenses [here](https://docs.sourcegraph.com/dev/background-information/ci#third-party-licenses).
You're safe to merge this pull request when the required checks are passing.
Test plan: CI should pass with any updates.
# token must be a personal access token for pull request to trigger other actions
# token must have `repo` scope
# currently @sourcegraph-bot cross-repo-github-actions in 1password
# configure in https://github.com/sourcegraph/sourcegraph/settings/secrets/GH_REPO_TOKEN
token: ${{ secrets.GH_REPO_TOKEN }}
- name: Enable pull request automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ secrets.GH_REPO_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash