diff --git a/.github/workflows/update-dependencies.yaml b/.github/workflows/update-dependencies.yaml new file mode 100644 index 0000000..c175871 --- /dev/null +++ b/.github/workflows/update-dependencies.yaml @@ -0,0 +1,44 @@ +name: Update Dependencies + +# controls when the action will run +on: + schedule: + - cron: '0 6 1 * *' # at 06:00 on the first day of every month + workflow_dispatch: # enables manual trigger + +jobs: + update_dependencies: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install poetry 1.1.12 + uses: snok/install-poetry@v1 + with: + version: 1.1.12 + + - name: Update dependencies + run: | + pip install poetryup + poetryup + if [ -n "$(git status --porcelain)" ]; then + # working tree NOT clean, bump project version + poetry version patch + fi + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + commit-message: Update dependencies + title: Update dependencies + labels: | + patch + branch: update-dependencies + delete-branch: true diff --git a/README.md b/README.md index 771aeb7..607bf62 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,11 @@ is that the latter also modifies the `pyproject.toml` file. poetryup ``` +## Automate Dependency Updates with GitHub Actions +Use PoetryUp with GitHub actions to automate the process of updating +dependencies, for reference see this project's [workflow +configuration](https://github.com/MousaZeidBaker/poetryup/blob/master/.github/workflows/update-dependencies.yaml). + ## Contributing Contributions are welcome via pull requests. diff --git a/pyproject.toml b/pyproject.toml index 5771f6e..9d5dab5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetryup" -version = "0.4.1" +version = "0.4.2" description = "Update dependencies and bump their version in the pyproject.toml file" authors = ["Mousa Zeid Baker"] packages = [