-
-
Notifications
You must be signed in to change notification settings - Fork 2k
62 lines (60 loc) · 1.83 KB
/
post-dependabot.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
53
54
55
56
57
58
59
60
61
62
name: Dependabot post-update
on:
pull_request_target:
action: [opened, synchronize, reopened]
branches:
- 'master'
- '[0-9].[0-9]+'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
post-update:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
- name: Generate Token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Login
run: |
echo "${{ steps.generate_token.outputs.token }}" | gh auth login --with-token
- name: Checkout
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- name: Setup Python
uses: actions/setup-python@v2
- name: Cache PyPI
uses: actions/cache@v2.1.7
with:
key: post-update-${{ hashFiles('requirements/*.txt') }}
path: ~/.cache/pip
restore-keys: |
post-update-
- name: Update pip, wheel, setuptools
run: |
python -m pip install -U pip wheel setuptools
- name: Install dependencies
run: |
python -m pip install -r requirements/dev.txt -c requirements/constraints.txt
- name: Run pip-compile
run: |
make compile-deps
- name: Check if compiled deps are changed
id: meta
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "::set-output name=changed::true"
else
echo "::set-output name=changed::false"
- name: Commit and push if needed
if: ${{ steps.meta.values.changed == 'true' }}
run: |
git add requirements/constraints.txt
git commit -m "Update constraints"
git push