Skip to content

Add AI-generated PR labeling workflow #269

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

Merged
merged 1 commit into from
Jun 16, 2025
Merged
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
11 changes: 11 additions & 0 deletions .github/workflows/label-ai-generated-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# .github/workflows/label-ai-generated-prs.yml
name: Label AI-generated PRs

on:
pull_request:
types: [opened, edited, synchronize] # run when the body changes too

jobs:
call-label-ai-prs:
uses: intercom/github-action-workflows/.github/workflows/label-ai-prs.yml@main
secrets: inherit
Comment on lines +10 to +11

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 2 days ago

To fix the issue, we will add a permissions block at the root of the workflow. This block will explicitly define the minimal permissions required for the workflow to function. Based on the context, the workflow likely needs contents: read to access repository contents and pull-requests: write to label pull requests. These permissions will be applied to all jobs in the workflow unless overridden by a job-specific permissions block.


Suggested changeset 1
.github/workflows/label-ai-generated-prs.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/label-ai-generated-prs.yml b/.github/workflows/label-ai-generated-prs.yml
--- a/.github/workflows/label-ai-generated-prs.yml
+++ b/.github/workflows/label-ai-generated-prs.yml
@@ -3,2 +3,6 @@
 
+permissions:
+  contents: read
+  pull-requests: write
+
 on:
EOF
@@ -3,2 +3,6 @@

permissions:
contents: read
pull-requests: write

on:
Copilot is powered by AI and may make mistakes. Always verify output.