-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.66 KB
/
udpdate.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
name: Update dependencies
on:
schedule:
- cron: 0 3 * * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.TOKEN }}
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: "Skip if no new version"
uses: Geode-solutions/actions/need-update@master
id: update
with:
token: ${{ secrets.TOKEN }}
- name: Remove old branch
uses: actions/github-script@v6
if: steps.update.outputs.update == 'true'
with:
script: |
const branch = await github.rest.git.listMatchingRefs({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/version-update"
})
console.log(branch)
if(!branch.data.length) return
github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/version-update"
})
- name: Update
if: steps.update.outputs.update == 'true'
run: |
pip install pip-tools
pip-compile --upgrade requirements.in
- uses: stefanzweifel/git-auto-commit-action@v4
if: steps.update.outputs.update == 'true'
with:
commit_message: Apply update changes
branch: version-update
create_branch: true
- name: pull-request
uses: repo-sync/pull-request@v2
if: steps.update.outputs.update == 'true'
with:
source_branch: version-update
destination_branch: develop
pr_reviewer: JulienChampagnol
github_token: ${{ secrets.TOKEN }}