-
-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (52 loc) · 1.83 KB
/
pip-compile-upgrade.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
name: pip-compile-upgrade
on:
schedule:
- cron: '0 20 * * 1'
workflow_dispatch:
jobs:
pip-compile-upgrade:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: pip-compile-dev-requirements
uses: coatl-dev/actions/pip-compile@v3
with:
path: requirements/dev.txt
python-version: '2.7'
- name: pip-compile-build-requirements
uses: coatl-dev/actions/pip-compile@v3
with:
path: requirements/build.txt
python-version: '3.12'
- name: Detect changes
id: git-diff
uses: coatl-dev/actions/simple-git-diff@v3
- name: Import GPG key
if: ${{ steps.git-diff.outputs.diff == 'true' }}
id: gpg-import
uses: coatl-dev/actions/gpg-import@v3
with:
passphrase: ${{ secrets.COATL_BOT_GPG_PASSPHRASE }}
private-key: ${{ secrets.COATL_BOT_GPG_PRIVATE_KEY }}
- name: Build commit message
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
echo "chore(requirements): pip-compile upgrade" > "$RUNNER_TEMP/commit.txt"
{
echo ""
echo "updates:"
git status --porcelain | awk 'match($1, "M") {print " - " $2}'
} >> "$RUNNER_TEMP/commit.txt"
- name: Commit and push changes
if: ${{ steps.git-diff.outputs.diff == 'true' }}
run: |
git checkout -B coatl-dev-pip-compile-upgrade
git add -u
git commit --file="${RUNNER_TEMP}/commit.txt"
git push --force --set-upstream origin coatl-dev-pip-compile-upgrade
- name: Create pull request
if: ${{ steps.git-diff.outputs.diff == 'true' }}
uses: coatl-dev/actions/pr-create@v3
with:
gh-token: ${{ secrets.COATL_BOT_GH_TOKEN }}