-
Notifications
You must be signed in to change notification settings - Fork 8
66 lines (62 loc) · 2.01 KB
/
Copy pathget_new_package_versions.yml
File metadata and controls
66 lines (62 loc) · 2.01 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
62
63
64
65
66
name: Get New Package Versions
# needed for creating PRs
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
jobs:
# first job will run a script to get a list of packages to update
check-for-updates:
runs-on: ubuntu-latest
outputs:
updates: ${{ steps.run-script.outputs.updates }}
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: install python deps
run: pip install aiohttp
- name: run the check-package-updates script
id: run-script
env:
SERVICE_ACCOUNT_PASSWORD: ${{ secrets.SERVICE_ACCOUNT_PASSWORD }}
SERVICE_ACCOUNT_USERNAME: ${{ secrets.SERVICE_ACCOUNT_USERNAME }}
run: ./hack/check-for-updates.py >> "$GITHUB_OUTPUT"
create-prs:
runs-on: ubuntu-latest
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.updates != '[]' }}
strategy:
matrix:
update: ${{ fromJSON(needs.check-for-updates.outputs.updates) }}
steps:
- name: checkout code
uses: actions/checkout@v4
- name: update the packages.txt
env:
update: ${{ matrix.update }}
run: ./hack/replace-package "$update"
- name: create PR
id: create-pr
uses: peter-evans/create-pull-request@v8
with:
add-paths: packages.txt
commit-message: Automatic build ${{ matrix.update }}
title: Automatic build ${{ matrix.update }}
branch-suffix: short-commit-hash
delete-branch: true
base: main
labels: |
automated build
- name: enable PR automerge
if: steps.create-pr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.create-pr.outputs.pull-request-nubmer }}
merge-method: rebase