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 81a091c commit ebd9685
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 42 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/auto-assign-action@v2.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
13 changes: 0 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,3 @@ jobs:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}


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 ebd9685

Please sign in to comment.