Skip to content

Commit e4f3945

Browse files
authored
Add Permissions to Ultralytics Actions format.yml (#156)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
1 parent 21bb9ef commit e4f3945

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/format.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
22

33
# Ultralytics Actions https://github.com/ultralytics/actions
4-
# This workflow automatically formats code and documentation in PRs to official Ultralytics standards
4+
# This workflow formats code and documentation in PRs to Ultralytics standards
55

66
name: Ultralytics Actions
77

88
on:
99
issues:
1010
types: [opened]
11-
discussion:
12-
types: [created]
1311
pull_request:
1412
branches: [main]
1513
types: [opened, closed, synchronize, review_requested]
1614

15+
permissions:
16+
contents: write # Modify code in PRs
17+
pull-requests: write # Add comments and labels to PRs
18+
issues: write # Add comments and labels to issues
19+
1720
jobs:
18-
Format:
21+
actions:
1922
runs-on: ubuntu-latest
2023
steps:
21-
- name: Run Ultralytics Formatting
24+
- name: Run Ultralytics Actions
2225
uses: ultralytics/actions@main
2326
with:
24-
token: ${{ secrets._GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
25-
labels: true # autolabel issues and PRs
26-
python: true # format Python code and docstrings
27-
prettier: true # format YAML, JSON, Markdown and CSS
28-
spelling: true # check spelling
29-
links: false # check broken links
30-
summary: true # print PR summary with GPT4o (requires 'openai_api_key')
31-
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
32-
27+
token: ${{ secrets._GITHUB_TOKEN || secrets.GITHUB_TOKEN }} # Auto-generated token
28+
labels: true # Auto-label issues/PRs using AI
29+
python: true # Format Python with Ruff and docformatter
30+
prettier: true # Format YAML, JSON, Markdown, CSS
31+
spelling: true # Check spelling with codespell
32+
links: false # Check broken links with Lychee
33+
summary: true # Generate AI-powered PR summaries
34+
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Powers PR summaries, labels and comments
35+
brave_api_key: ${{ secrets.BRAVE_API_KEY }} # Used for broken link resolution
3336
CLA:
3437
runs-on: ubuntu-latest
3538
if: github.event_name == 'pull_request_DISABLED'

0 commit comments

Comments
 (0)