Skip to content
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
16 changes: 16 additions & 0 deletions .github/workflows/needs-triage-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: needs-triage

on:
issues:
types:
- opened
- reopened
- transferred

permissions:
issues: write

jobs:
needs-triage:
uses: mdn/workflows/.github/workflows/needs-triage.yml@main
if: github.repository_owner == 'mdn'
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
24 changes: 24 additions & 0 deletions .github/workflows/needs-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: needs-triage

on:
workflow_call:
inputs:
label:
description: The label to add to the issue.
default: "needs triage"
required: false
type: string

permissions:
issues: write

jobs:
needs-triage:
runs-on: ubuntu-latest
steps:
- name: Add label
env:
GITHUB_TOKEN: ${{ github.token }}
ISSUE_URL: ${{ github.event.issue.html_url }}
LABEL: ${{ inputs.label }}
run: gh issue edit "$ISSUE_URL" --add-label "$LABEL"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Reusable GitHub Actions workflows for use in MDN repositories.

- [auto-merge](.github/workflows/auto-merge.yml) ([docs](docs/auto-merge.md)) - automatically merge pull requests
- [lock-closed](.github/workflows/lock-closed.yml) ([docs](docs/lock-closed.md)) - lock closed issues and pull requests
- [needs-triage](.github/workflows/needs-triage.yml) ([docs](docs/needs-triage.md)) - label issues that need triage when opened, reopened, or transferred
- [new-issues](.github/workflows/new-issues.yml) ([docs](docs/new-issues.md)) - label new issues
- [pr-rebase-needed](.github/workflows/pr-rebase-needed.yml) ([docs](docs/pr-rebase-needed.md)) - label pull requests that have merge conflicts
64 changes: 64 additions & 0 deletions docs/needs-triage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# needs-triage

The `needs-triage` reusable action is located at [`.github/workflows/needs-triage.yml`](https://github.com/mdn/workflows/tree/main/.github/workflows/needs-triage.yml).

It adds a label (default: `needs triage`) to an issue when it is opened, reopened, or transferred.

## Inputs

### Optional inputs

#### label

The label to add to the issue.

- This `input` is optional with a default of `needs triage`.

## Usage

In the repository that will call this action, add a `.github/workflows/needs-triage.yml` file with the following content:

### With defaults

```yml
name: needs-triage

on:
issues:
types:
- opened
- reopened
- transferred

jobs:
needs-triage:
uses: mdn/workflows/.github/workflows/needs-triage.yml@main
```

To prevent execution on forks, add an `if` condition to the job:

```yml
jobs:
needs-triage:
if: github.repository_owner == 'mdn'
uses: mdn/workflows/.github/workflows/needs-triage.yml@main
```

### Overriding the label

```yml
name: needs-triage

on:
issues:
types:
- opened
- reopened
- transferred

jobs:
needs-triage:
uses: mdn/workflows/.github/workflows/needs-triage.yml@main
with:
label: "triage"
```