Skip to content

Commit

Permalink
Additional Dependabot Tweaks (#944)
Browse files Browse the repository at this point in the history
* split by major/minor

* fix linting

* try to fix unique directory constraint

* try to fix unique directory constraint

* condense into one block

* removing junk config

* Add pip-compile workflow

* added major/minor groups

* fixed default branch for compile

* change file type for workflow
  • Loading branch information
nevoodoo authored Sep 23, 2024
1 parent ffccabf commit 516eafc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ updates:
interval: "weekly"
open-pull-requests-limit: 10
groups:
python-packages:
minor-and-patch:
patterns:
- "*"
- "requirements.in"
- "requirements-dev.in"
update-types:
- "minor"
- "patch"

major:
patterns:
- "requirements.in"
- "requirements-dev.in"
update-types:
- "major"
39 changes: 39 additions & 0 deletions .github/workflows/compile_requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Compile Requirements with Docker

on:
pull_request:
types: [opened, synchronize]
branches:
- dev
workflow_dispatch: # Allows manual triggering

jobs:
compile-requirements:
if: github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' # Run for Dependabot PRs or manual trigger
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run pip-compile in Docker
run: |
docker run --platform linux/amd64 \
-v ${{ github.workspace }}:/opt/metamist \
--workdir /opt/metamist \
--rm python:3.10-slim bash -c " \
pip install pip-tools && \
echo 'Installed pip-tools!'; \
echo 'Compiling from requirements.in'; \
pip-compile requirements.in > requirements.txt && \
echo 'Compiling from requirements-dev.in'; \
pip-compile --output-file=requirements-dev.txt requirements-dev.in requirements.in"
- name: Commit updated requirements files
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git add requirements.txt requirements-dev.txt
git commit -m "Auto-compile requirements.txt and requirements-dev.txt"
git push
continue-on-error: true

0 comments on commit 516eafc

Please sign in to comment.