-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (33 loc) · 1.24 KB
/
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
name: check for ruff updates
on: {workflow_dispatch, schedule: [cron: '0 */6 * * *']}
jobs:
check-for-updates:
runs-on: ubuntu-22.04
name: check for ruff updates
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
steps:
- uses: actions/[email protected]
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: x64
- id: version
name: check version
run: |
pip install -U ruff
pip freeze | grep 'ruff==' >requirements.txt
version="$(sed -E 's#ruff==(.*)#\1#g' ./requirements.txt)"
echo "version=$version" >>$GITHUB_OUTPUT
echo "message=automatic ruff update [$version]" >>$GITHUB_OUTPUT
- uses: peter-evans/[email protected]
id: new_pull_request
with:
delete-branch: true
title: ${{ steps.version.outputs.message }}
commit-message: ${{ steps.version.outputs.message }}
branch: automatic-ruff-update
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- if: steps.new_pull_request.outputs.pull-request-url != ''
run: gh pr merge --auto --squash ${{ steps.new_pull_request.outputs.pull-request-url }}