-
Notifications
You must be signed in to change notification settings - Fork 58
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
c59f9d7
commit 993a685
Showing
1 changed file
with
54 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,54 @@ | ||
|
||
# This is a basic workflow to run unit tests | ||
|
||
name: Update Requirements | ||
|
||
on: | ||
push: | ||
paths: | ||
- pyproject.toml | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
steps: | ||
# Checkout | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# Check commit message | ||
- id: check | ||
run: | | ||
MESSAGE=$(git log -1 --pretty=%B) | ||
if [[ "$MESSAGE" == *"[skip ci]"* ]]; then | ||
echo "::set-output name=skip::true" | ||
else | ||
echo "::set-output name=skip::false" | ||
fi | ||
# If commit message doesn't contain "[skip ci]", continue to the next steps | ||
- name: Set up Python | ||
if: steps.check.outputs.skip != 'true' | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Dependencies | ||
if: steps.check.outputs.skip != 'true' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Bump version, update requirements.txt and set output | ||
if: steps.check.outputs.skip != 'true' | ||
id: bump_version_and_set_output | ||
run: | | ||
poetry export --without-hashes --format=requirements.txt > requirements.txt | ||
git checkout main | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add pyproject.toml requirements.txt | ||
git commit -m "Update requirements.txt [skip ci]" |