From 966a0b6890b81a918ca5173aeb7d7342a5e905aa Mon Sep 17 00:00:00 2001 From: Peter Gorniak Date: Mon, 22 Feb 2021 12:19:04 -0800 Subject: [PATCH] Test auto pr (#336) Make PR instead of trying to push to branch. Use `pull_request_target` to run on base version of PR and hopefully have correct permissions to make a PR. --- .github/workflows/compile_card_db.yml | 23 +++++++++-------------- .github/workflows/lint_and_test.yml | 11 ++++++++++- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/compile_card_db.yml b/.github/workflows/compile_card_db.yml index 91c09fc..b34b1c9 100644 --- a/.github/workflows/compile_card_db.yml +++ b/.github/workflows/compile_card_db.yml @@ -1,6 +1,6 @@ name: Compile Card DB -on: [push, pull_request, workflow_dispatch] +on: [pull_request_target, workflow_dispatch] jobs: compile_card_db: @@ -15,17 +15,12 @@ jobs: pip install . - name: Update Languages run: doit update_languages - - uses: dorny/paths-filter@v2 - id: filter + - name: Make PR + uses: peter-evans/create-pull-request@v3 with: - base: HEAD - filters: | - cardb_target: - - src/domdiv/card_db/** - - name: Commit Results - if: steps.filter.outputs.cardb_target == 'true' - run: | - git config --global user.name 'Github Action: Compile Card DB' - git config --global user.email 'sumpfork@users.noreply.github.com' - git commit -am "Compile Card DB" - git push + base: ${{ github.head_ref }} + body: | + Auto-generate package card DB to from source card DB + delete-branch: true + reviewers: sumpfork + assignees: sumpfork diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 6068fcc..4c5da1d 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -1,6 +1,6 @@ name: Lint and Test -on: [push, pull_request, workflow_dispatch] +on: [pull_request_target, workflow_dispatch] jobs: lint_and_test: @@ -14,5 +14,14 @@ jobs: pip install -r requirements.txt - name: Lint run: pre-commit run --all-files + - name: Make PR + uses: peter-evans/create-pull-request@v3 + with: + base: ${{ github.head_ref }} + body: | + Fix style/lint issues + delete-branch: true + reviewers: sumpfork + assignees: sumpfork - name: Test run: python setup.py test