generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (60 loc) · 2.31 KB
/
auto-update.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
63
64
65
66
67
---
name: Check external dependency repo changes
on: # yamllint disable-line rule:truthy
schedule:
- cron: '23 2 * * *' # Runs at 02:23 UTC every day
workflow_dispatch:
jobs:
update-actions-setup-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- run: npm ci
- name: Get last version of actions/setup-python
id: setup-python
run: |
pip install lastversion
echo version=$(python -m lastversion actions/setup-python) >> $GITHUB_OUTPUT
- name: Update actions/setup-python
run: |
VERSION=${{ steps.setup-python.outputs.version }}
npm i git+https://[email protected]/actions/setup-python.git#v$VERSION
- run: npm run build
- uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT }}
commit-message: :arrow_up:Update actions/setup-python
title: ⬆[Automated] Update of actions/setup-python
body: This is an auto-generated PR with external GitHub repo updates.
branch: auto-update-setup-python
update-poetry-latest-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get latest Poetry version
id: poetry
run: |
pip install lastversion
echo version=$(python -m lastversion python-poetry/poetry) >> $GITHUB_OUTPUT
- name: Edit and update inputs.poetry-version in action.yml
shell: python
run: |
from pathlib import Path
import re
path = Path("action.yml")
source = path.read_text()
target = source.split("{{ poetry-version }}")[1].split("\n")[1]
match = re.search(r"default: '.*?'", target)
version = "${{ steps.poetry.outputs.version }}"
result = source.replace(match.group(), f"default: '{version}'")
path.write_text(result)
- uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT }}
commit-message: :arrow_up:Update poetry latest version
title: ⬆[Automated] Update inputs.poetry-version in action.yml
body: This is an auto-generated PR with poetry latest version updates.
branch: auto-update-poetry-latest