Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows to be same as main repo #37

Merged
merged 6 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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