Skip to content

Commit

Permalink
Merge pull request #35 from rohanpm/playbook-updates
Browse files Browse the repository at this point in the history
chore: update pip-compile workflow
  • Loading branch information
rohanpm committed Jun 30, 2021
2 parents c7abbb0 + 7f80184 commit 0736bca
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pip-compile-merge.yml
@@ -0,0 +1,23 @@
on:
workflow_dispatch: {}
schedule:
- cron: "20 20 * * 2"

name: "pip-compile: merge PR"
jobs:
pip_compile_merge:
name: pip-compile automerge
runs-on: ubuntu-latest
steps:
- name: Look up pull request
uses: juliangruber/find-pull-request-action@v1
id: find-pull-request
with:
branch: deps/pip-compile
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.find-pull-request.outputs.number }}
method: merge
if: ${{ steps.find-pull-request.outputs.number }}
55 changes: 55 additions & 0 deletions .github/workflows/pip-compile.yml
@@ -0,0 +1,55 @@
on:
workflow_dispatch: {}
schedule:
- cron: "20 20 * * 0"

name: "pip-compile: create PR"
jobs:
pip_compile:
name: pip-compile
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
# TODO: multi-version support
python-version: 3.8


- name: pip-compile
uses: technote-space/create-pr-action@v2
with:
EXECUTE_COMMANDS: |
pip install pip-tools
pip-compile -U --generate-hashes requirements.in
pip-compile -U --generate-hashes test-requirements.in
COMMIT_MESSAGE: 'chore: scheduled pip-compile'
COMMIT_NAME: 'GitHub Actions'
COMMIT_EMAIL: 'noreply@github.com'
PR_BRANCH_PREFIX: deps/
PR_BRANCH_NAME: 'pip-compile'
PR_TITLE: 'chore: scheduled pip-compile'
PR_BODY: '## Update dependencies
This is a scheduled update of Python dependencies within this repo managed by pip-compile.
This change will be submitted automatically within a few days if all checks have
succeeded.'


- name: Look up pull request
uses: juliangruber/find-pull-request-action@v1
id: find-pull-request
with:
branch: deps/pip-compile

# Immediately approve it if we can so it can be merged later
- name: Approve Pull Request
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ secrets.APPROVAL_TOKEN }}
number: ${{ steps.find-pull-request.outputs.number }}
# allow errors because token may be unset.
continue-on-error: true
if: ${{ steps.find-pull-request.outputs.number }}

0 comments on commit 0736bca

Please sign in to comment.