Skip to content

Commit

Permalink
Consolidate various PR tasks
Browse files Browse the repository at this point in the history
These will run on every PR, unlike tests, and will use
pull_request_target to get access to secrets
  • Loading branch information
pvandyken committed May 9, 2024
1 parent 81f4ae9 commit 5026e0a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 43 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/assign.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/labeler.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pull requests

on:
pull_request_target: # Default: ['opened', 'synchronize', 'reopened']
types: ["opened", "synchronize", "reopened", "ready_for_review"]

jobs:
labeller:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5

deployment_on_base:
runs-on: ubuntu-latest
steps:
- name: Check for previous deployment on base
run: |
[[ $(
curl https://api.github.com/repos/${{ github.repository }}/releases |
jq '.[].target_commitish == "${{ github.event.pull_request.base.ref }}"' |
grep true | wc -l
) != 0 ]]
assign:
runs-on: ubuntu-latest
if: github.event.pull_request.assignee == null

steps:
- name: Assign reviewer
uses: kentaro-m/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
14 changes: 0 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,3 @@ jobs:
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.split }}
path: ./coverage.xml



deployment_on_base:
runs-on: ubuntu-latest
if: ${{ contains(github.event_name, 'pull_request') }}
steps:
- name: Check for previous deployment on base
run: |
[[ $(
curl https://api.github.com/repos/${{ github.repository }}/releases |
jq '.[].target_commitish == "${{ github.event.pull_request.base.ref }}"' |
grep true | wc -l
) != 0 ]]

0 comments on commit 5026e0a

Please sign in to comment.