-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
846d952
commit cd93088
Showing
1 changed file
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Pip Compile | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- 'requirements.in' | ||
- 'requirements-windows.in' | ||
- 'requirements-dev.in' | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} # Check out the PR branch | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install Pip Tools | ||
run: pip install pip-tools | ||
|
||
- name: Run Pip Compile | ||
run: pip-compile | ||
|
||
- name: Check for changes | ||
id: changes | ||
run: | | ||
if [[ -n $(git status --porcelain) ]]; then | ||
echo "changes_detected=true" >> $GITHUB_ENV | ||
else | ||
echo "changes_detected=false" >> $GITHUB_ENV | ||
fi | ||
- name: Commit changes | ||
if: env.changes_detected == 'true' | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "chore: \`pip-compile\`" | ||
git push |