Skip to content

Commit

Permalink
Update workflows to be same as main repo (#37)
Browse files Browse the repository at this point in the history
* Update labeler.yml

* Delete .github/workflows/dummy-conflicts.yml

* Update conflicts.yml

* Update remove-outdated-labels.yml

* Rename labeler.yml to pr-labeler.yml

* Update label-pr.yml
  • Loading branch information
1 parent 4194dc2 commit 6bdc903
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
4 changes: 0 additions & 4 deletions .github/labeler.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'PR: waiting for review':
- changed-files:
- any-glob-to-any-file: '**'
3 changes: 0 additions & 3 deletions .github/workflows/conflicts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
# In `pull_request` we wouldn't be able to change labels of fork PRs
pull_request_target:
types: [synchronize]
workflow_run:
workflows: ['Dummy workflow for conflicts']
types: [requested]

jobs:
main:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/dummy-conflicts.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: "Pull Request Labeler"
on:
pull_request_target:
types: [opened, reopened]
types: [opened, reopened, ready_for_review]

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/pr-labeler.yml
31 changes: 28 additions & 3 deletions .github/workflows/remove-outdated-labels.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Remove outdated labels
on:
# https://github.community/t/github-actions-are-severely-limited-on-prs/18179/15
pull_request_target:
types:
- closed
- converted_to_draft
- ready_for_review
jobs:
remove-merged-pr-labels:
name: Remove merged pull request labels
Expand All @@ -19,10 +20,11 @@ jobs:
PR: changes requested
PR: merge conflicts / rebase needed
PR/Issue: dependent
PR: stale
remove-closed-pr-labels:
name: Remove closed pull request labels
if: github.event_name == 'pull_request_target' && (! github.event.pull_request.merged)
if: github.event_name == 'pull_request_target' && (! github.event.pull_request.merged) && (github.event.action != 'converted_to_draft') && (github.event.action != 'ready_for_review')
runs-on: ubuntu-latest
steps:
- uses: mondeja/[email protected]
Expand All @@ -33,4 +35,27 @@ jobs:
PR: WIP
PR: changes requested
PR: merge conflicts / rebase needed
PR/Issue: dependent
PR/Issue: dependent
PR: stale
remove-draft-pr-labels:
name: Remove labels from draft pull requests
if: github.event_name == 'pull_request_target' && github.event.action == 'converted_to_draft'
runs-on: ubuntu-latest
steps:
- uses: mondeja/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
PR: waiting for review
remove-ready-pr-labels:
name: Remove labels when draft pr is marked ready for review
if: github.event_name == 'pull_request_target' && github.event.action == 'ready_for_review'
runs-on: ubuntu-latest
steps:
- uses: mondeja/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
PR: WIP

0 comments on commit 6bdc903

Please sign in to comment.