Skip to content

Commit be56227

Browse files
sjnimsclaude
andcommitted
fix: improve workflow security, reliability, and documentation
HIGH PRIORITY - Security: - Add explicit permissions to links.yml (contents: read, issues: write) - Add explicit permissions to markdownlint.yml (contents: read) - Add explicit permissions to validate-workflows.yml (contents: read) MEDIUM PRIORITY - Reliability: - Add timeout-minutes to all Claude-powered workflows to prevent runaway jobs - ci-failure-analysis: 10min - claude-pr-review: 10min - claude.yml: 15min - component-validation: 10min - semantic-labeler: 5min (both jobs) - version-check: 5min - weekly-maintenance: 15min - Add duplicate issue check to weekly-maintenance.yml (closes old reports) - Add bot exclusion to greet.yml (skip dependabot and claude bots) LOW PRIORITY - Operational: - Add operations-per-run and enable-statistics to stale.yml - Add clarifying comments for issues:write permission scopes - Add documentation header to links.yml explaining lychee flags 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent efabd18 commit be56227

12 files changed

+50
-2
lines changed

.github/workflows/ci-failure-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
github.event.workflow_run.actor.login != 'dependabot[bot]' &&
2828
github.event.workflow_run.actor.login != 'claude[bot]'
2929
runs-on: ubuntu-latest
30+
timeout-minutes: 10
3031
permissions:
3132
contents: read
3233
pull-requests: write

.github/workflows/claude-pr-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
github.actor != 'claude[bot]' &&
2121
github.event.pull_request.draft == false
2222
runs-on: ubuntu-latest
23+
timeout-minutes: 10
2324
permissions:
2425
contents: read
2526
pull-requests: write
26-
issues: write
27+
issues: write # Required by claude-code-action for PR comments (GitHub API treats PR comments as issue comments)
2728
id-token: write
2829
actions: read
2930
steps:

.github/workflows/claude.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association))
3939
)
4040
runs-on: ubuntu-latest
41+
timeout-minutes: 15
4142
permissions:
4243
contents: write # Write access for pushing branches
4344
pull-requests: write

.github/workflows/component-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ jobs:
2222
github.actor != 'claude[bot]' &&
2323
github.event.pull_request.draft == false
2424
runs-on: ubuntu-latest
25+
timeout-minutes: 10
2526
permissions:
2627
contents: read
2728
pull-requests: write
28-
issues: write
29+
issues: write # Recommended by claude-code-action docs for full functionality
2930
id-token: write
3031
actions: read
3132
steps:

.github/workflows/greet.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ concurrency:
1414

1515
jobs:
1616
greeting:
17+
# Skip bot accounts to avoid greeting automated tools
18+
if: github.actor != 'dependabot[bot]' && github.actor != 'claude[bot]'
1719
runs-on: ubuntu-latest
1820
permissions:
1921
issues: write

.github/workflows/links.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Check Links
22

3+
# Checks all markdown files for broken links using lychee
4+
# Key flags:
5+
# --cache: Cache results to speed up subsequent runs
6+
# --exclude-link-local: Skip localhost/127.0.0.1 links (not reachable in CI)
7+
# --exclude-file: Use .lycheeignore for links that shouldn't be checked (e.g., rate-limited sites)
8+
# Creates a GitHub issue on failure for visibility
9+
310
on:
411
pull_request:
512
paths:
@@ -12,6 +19,10 @@ concurrency:
1219
group: ${{ github.workflow }}-${{ github.ref }}
1320
cancel-in-progress: true
1421

22+
permissions:
23+
contents: read
24+
issues: write # Required by peter-evans/create-issue-from-file on failure
25+
1526
jobs:
1627
linkChecker:
1728
name: Check Markdown Links

.github/workflows/markdownlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
lint:
1922
name: Lint Markdown Files

.github/workflows/semantic-labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
github.actor != 'dependabot[bot]' &&
2424
github.actor != 'claude[bot]'
2525
runs-on: ubuntu-latest
26+
timeout-minutes: 5
2627
permissions:
2728
contents: read
2829
issues: write
@@ -117,6 +118,7 @@ jobs:
117118
github.actor != 'claude[bot]' &&
118119
github.event.pull_request.draft == false
119120
runs-on: ubuntu-latest
121+
timeout-minutes: 5
120122
permissions:
121123
contents: read
122124
pull-requests: write

.github/workflows/stale.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ jobs:
2929
stale-pr-label: 'stale'
3030
exempt-issue-labels: 'pinned,security,roadmap'
3131
exempt-pr-labels: 'pinned,security'
32+
operations-per-run: 100 # Limit API calls per run to avoid rate limiting
33+
enable-statistics: true # Log statistics for monitoring

.github/workflows/validate-workflows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
actionlint:
1922
name: Lint GitHub Actions Workflows

0 commit comments

Comments
 (0)