Skip to content

Commit 752d1a8

Browse files
committed
fix: address review comments (indentation, null check, diagram, permissions docs)
1 parent c4f35cd commit 752d1a8

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

ISSUE_LIFECYCLE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ flowchart TD
1010
B --> C{Triage}
1111
1212
C -->|clear & well-scoped| D[label: backlog]
13-
C -->|unclear scope| E[label: needs-refinement]
13+
C -->|unclear scope| E[labels: needs-refinement + backlog]
1414
C -->|duplicate / out of scope / won't fix| F([Closed])
1515
C -->|missing info| G[label: needs-more-info]
1616

workflows/issue-project-sync/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
}
3636
}' -f org="$ORG" -F number="$PROJECT_NUMBER" --jq '.data.organization.projectV2.id')
3737
38-
if [ -z "$PROJECT_ID" ]; then
38+
if [ -z "$PROJECT_ID" ] || [ "$PROJECT_ID" = "null" ]; then
3939
echo "ERROR: Could not find project #${PROJECT_NUMBER} in org ${ORG}"
4040
exit 1
4141
fi

workflows/issue-triage/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,26 @@ A reusable composite action that automatically labels new issues with `needs-tri
44

55
## Usage
66

7-
Create `.github/workflows/issue-triage.yml` in your repository:
7+
Create `.github/workflows/issue-triage.yaml` in your repository:
88

99
```yaml
1010
name: Issue Triage
1111
on:
1212
issues:
1313
types: [opened]
1414

15+
permissions:
16+
issues: write
17+
1518
jobs:
1619
triage:
1720
runs-on: ubuntu-latest
1821
steps:
1922
- uses: cloudoperators/common/workflows/issue-triage@main
2023
```
2124
25+
> **Important:** The calling workflow **must** declare `permissions: issues: write`. Without this, the action will fail in repos/orgs where the default `GITHUB_TOKEN` is read-only.
26+
2227
## What it does
2328

2429
1. Adds the `needs-triage` label to the newly opened issue
@@ -30,7 +35,8 @@ jobs:
3035
## Prerequisites
3136

3237
- The `needs-triage` label must exist in the repository (see label setup below)
33-
- The default `GITHUB_TOKEN` is sufficient — no additional secrets needed
38+
- The calling workflow must grant `permissions: issues: write`
39+
- The default `GITHUB_TOKEN` is sufficient for the token — no additional secrets needed
3440

3541
## Label Setup
3642

workflows/issue-triage/action.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Auto-label new issues with needs-triage and post a welcome comment
33

44
inputs:
55
GH_TOKEN:
6-
description: 'GitHub token with issues write permission. Can use the default GITHUB_TOKEN.'
6+
description: 'GitHub token with issues write permission. The calling workflow must grant permissions: issues: write.'
77
required: false
88
default: ${{ github.token }}
99

@@ -24,13 +24,17 @@ runs:
2424
GH_TOKEN: ${{ inputs.GH_TOKEN }}
2525
ISSUE_URL: ${{ github.event.issue.html_url }}
2626
run: |
27-
gh issue comment "$ISSUE_URL" --body "Thanks for opening this issue! 🎉
27+
BODY=$(cat <<'EOF'
28+
Thanks for opening this issue! 🎉
2829

29-
A maintainer will triage it within 5 business days. You can learn more about our issue workflow in the [Issue Lifecycle documentation](https://github.com/cloudoperators/common/blob/main/ISSUE_LIFECYCLE.md).
30+
A maintainer will triage it within 5 business days. You can learn more about our issue workflow in the [Issue Lifecycle documentation](https://github.com/cloudoperators/common/blob/main/ISSUE_LIFECYCLE.md).
3031

31-
In the meantime, please make sure you have provided:
32-
- A clear problem statement
33-
- Steps to reproduce (for bugs)
34-
- Expected vs actual behavior
32+
In the meantime, please make sure you have provided:
33+
- A clear problem statement
34+
- Steps to reproduce (for bugs)
35+
- Expected vs actual behavior
3536

36-
This helps us route your issue faster."
37+
This helps us route your issue faster.
38+
EOF
39+
)
40+
gh issue comment "$ISSUE_URL" --body "$BODY"

0 commit comments

Comments
 (0)