Check external dependency repo changes #778
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |