-
Notifications
You must be signed in to change notification settings - Fork 15
56 lines (49 loc) · 1.71 KB
/
update_python_requirements.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
name: Bump requirements.txt
on:
pull_request:
paths:
- 'packages/python/sshnpd/pyproject.toml'
workflow_dispatch:
# Declare default permissions as read only.
permissions: read-all
jobs:
bump_requirements:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout this repo
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Set up Python
if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: '3.11'
- name: Install Poetry
if: ${{ github.actor == 'dependabot[bot]' }}
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 # v3.0.0
with:
poetry-version: '1.8.3'
- name: Bump sshnpd Python dependencies
working-directory: packages/python/sshnpd
if: ${{ github.actor == 'dependabot[bot]' }}
run: |
poetry update
poetry export --format requirements.txt --output requirements.txt
git config --global user.name 'dependabot[bot]'
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
git add requirements.txt
if [ -z "$(git status --porcelain)" ]; then
echo 'No changes to commit on this run'
exit 0
else
poetry version patch
git add pyproject.toml
git commit -m "build(deps): Bump sshnpd requirements.txt and poetry version"
git push
fi