-
Notifications
You must be signed in to change notification settings - Fork 70
Enable Factory Droid @droid tag responses #189
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||||||||||||||
| name: Droid Tag | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| issue_comment: | ||||||||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||||||
| pull_request_review_comment: | ||||||||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||||||
| issues: | ||||||||||||||||||||||||||
| types: [opened, assigned] | ||||||||||||||||||||||||||
| pull_request_review: | ||||||||||||||||||||||||||
| types: [submitted] | ||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||
| types: [opened, edited] | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
| droid: | ||||||||||||||||||||||||||
| if: | | ||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Workflow triggers on untrusted issue comments without author validation Untrusted users can trigger third-party action runs by posting Add AI prompt |
||||||||||||||||||||||||||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@droid')) || | ||||||||||||||||||||||||||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@droid')) || | ||||||||||||||||||||||||||
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@droid')) || | ||||||||||||||||||||||||||
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@droid') || contains(github.event.issue.title, '@droid'))) || | ||||||||||||||||||||||||||
| (github.event_name == 'pull_request' && (contains(github.event.pull_request.body, '@droid') || contains(github.event.pull_request.title, '@droid'))) | ||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Gate @droid runs to avoid noisy failures and wasted CI As written, any issue/PR comment (or issue/PR body) containing
Suggested change
|
||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||||||
| issues: write | ||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Overly broad workflow permissions include Job grants Remove unnecessary permissions and use least-privilege access. AI prompt |
||||||||||||||||||||||||||
| actions: read | ||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||
| uses: actions/checkout@v5 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| fetch-depth: 1 | ||||||||||||||||||||||||||
| - name: Run Droid Exec | ||||||||||||||||||||||||||
| uses: Factory-AI/droid-action@main | ||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Pin Factory-AI/droid-action to a commit SHA Using
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Workflow uses unpinned third-party action with mutable Unpinned third-party action Pin the action to a specific commit SHA to prevent supply-chain attacks. AI prompt |
||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| factory_api_key: ${{ secrets.FACTORY_API_KEY }} | ||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Workflow lacks top-level permissions block to restrict default GITHUB_TOKEN scope
No top-level permissions block means default token permissions depend on repo settings.
Add permissions: {} at the workflow level for defense-in-depth.
AI prompt