-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
- Loading branch information
Showing
2 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Run pip-compile whenever pydantic/pydantic core is updated by Dependabot | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
paths: | ||
- requirements.txt | ||
- requirements-extras.txt | ||
push: | ||
branches: | ||
- "dependabot/**" | ||
workflow_dispatch: | ||
inputs: {} | ||
|
||
jobs: | ||
update-pydantic-core: | ||
if: ${{ startsWith(github.event.pull_request.head.ref || github.ref, 'dependabot/') && | ||
contains(github.event.head_commit.message, 'pydantic') }} | ||
runs-on: ubuntu-24.04 | ||
container: | ||
image: python:3.9-alpine | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Step 2: Install dependencies needed for pip-compile | ||
- name: Install dependencies | ||
run: | | ||
apk update && apk add --no-cache git | ||
pip install --upgrade pip | ||
pip install pip-tools | ||
# Step 4: Run pip-compile to update requirements.txt based on pyproject.toml | ||
- name: Run pip-compile to update requirements.txt | ||
run: | | ||
pip-compile --generate-hashes --output-file=requirements.txt pyproject.toml | ||
# Step 5: Commit and push updated requirements.txt to Dependabot's PR branch | ||
- name: Commit and push updated requirements files | ||
run: | | ||
git config --global user.email "dependabot@users.noreply.github.com" | ||
git config --global user.name "dependabot[bot]" | ||
git add -u | ||
git commit --amend --no-edit | ||
git push --force |