Scan every pull request automatically, restricted to the files it changed, with one workflow file.
Add a workflow that checks out a pull request’s head commit, then scans only what it changed against its base branch. See Scan a pull request for the --diff syntax this relies on.
Add a provider secret
Add your provider’s credential as a repository secret first. This example uses ANTHROPIC_API_KEY. See Providers for the full list.
The workflow file
Save this as .github/workflows/agentgg.yml.
GitHub does not expose repository secrets to a pull_request workflow triggered from a fork. The if guard below skips the scan for a fork pull request. Without it, the scan would run with an empty API key and fail. Do not switch to pull_request_target to work around this: it runs the fork’s code with your secrets and is a known security risk.
fetch-depth: 0 is required. Without full history, git cannot compute the merge base for the three-dot range, and the scan fails.
The job uploads scan-results as a build artifact on every run, pass or fail. Download it from the workflow run page to read summary.md and the per-finding files under findings/. See Resume and reports for their shape.A pull request from a fork skips the job. No scan runs and nothing uploads for it.Full flag list: Scan flags.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"AgentGG","colors":{"primary":"#ff8c42","light":"#ffaa6b","dark":"#e0701f"},"logo":{"light":"https://mintcdn.com/agent-gg/98PlcJv2abehqhSS/images/logo-wordmark-light.png?fit=max\u0026auto=format\u0026n=98PlcJv2abehqhSS\u0026q=85\u0026s=fc389901d63eb050a08135dcc324f948","dark":"https://mintcdn.com/agent-gg/98PlcJv2abehqhSS/images/logo-wordmark-dark.png?fit=max\u0026auto=format\u0026n=98PlcJv2abehqhSS\u0026q=85\u0026s=8e0660ccb92abf8efb0bdf1ddadc7a48","href":"/"},"favicon":"https://mintcdn.com/agent-gg/98PlcJv2abehqhSS/images/favicon.png?fit=max\u0026auto=format\u0026n=98PlcJv2abehqhSS\u0026q=85\u0026s=d95023cfb56fd82eeb219c36eefad304","appearance":{"default":"dark"},"background":{"decoration":"grid","color":{"dark":"#0a1018"}},"navbar":{"links":[{"href":"https://github.com/agentgg-dev/agentgg","label":"GitHub"}],"primary":{"type":"button","label":"Open the platform","href":"https://app.agentgg.dev"}},"footer":{"socials":{"github":"https://github.com/agentgg-dev"}},"fonts":{"family":"Inter"},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"agent-gg","hasAudioNarration":false,"actualSubdomain":"agent-gg","customDomains":["docs.agentgg.dev"],"gitSource":{"type":"github","owner":"agentgg-dev","repo":"agentgg-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6acad1f130925e44ebb4fd2b","clientVersion":"0.0.4340","searchFilterCounts":[{"language":"default","tag":"CLI","count":19},{"language":"default","tag":"Get started","count":13},{"language":"default","tag":"Platform","count":11},{"language":"default","tag":"Guides","count":8},{"language":"default","tag":"Agents","count":6},{"language":"default","tag":"Scanning","count":4},{"language":"default","tag":"Help","count":3},{"language":"default","tag":"Reference","count":3},{"language":"default","tag":"Concepts","count":2},{"language":"default","tag":"Providers","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2.5rem}"}]}
{"page":{"pagePath":"cli/guides/github-actions","slug":"/cli/guides/github-actions","pageMetadata":{"title":"Run agentgg in GitHub Actions","description":"Scan every pull request automatically, restricted to the files it changed, with one workflow file.","href":"/cli/guides/github-actions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Scan every pull request automatically, restricted to the files it changed, with one workflow file.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Add a workflow that checks out a pull request’s head commit, then scans only what it changed against its base branch. See `,_jsx(_components.a,{href:`/cli/guides/scan-a-pull-request`,children:`Scan a pull request`}),` for the `,_jsx(_components.code,{children:`--diff`}),` syntax this relies on.`]}),`\n`,_jsx(Heading,{level:`2`,id:`add-a-provider-secret`,children:`Add a provider secret`}),`\n`,_jsxs(_components.p,{children:[`Add your provider’s credential as a repository secret first. This example uses `,_jsx(_components.code,{children:`ANTHROPIC_API_KEY`}),`. See `,_jsx(_components.a,{href:`/cli/providers`,children:`Providers`}),` for the full list.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-workflow-file`,children:`The workflow file`}),`\n`,_jsxs(_components.p,{children:[`Save this as `,_jsx(_components.code,{children:`.github/workflows/agentgg.yml`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`GitHub does not expose repository secrets to a `,_jsx(_components.code,{children:`pull_request`}),` workflow triggered from a fork. The `,_jsx(_components.code,{children:`if`}),` guard below skips the scan for a fork pull request. Without it, the scan would run with an empty API key and fail. Do not switch to `,_jsx(_components.code,{children:`pull_request_target`}),` to work around this: it runs the fork’s code with your secrets and is a known security risk.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`fetch-depth: 0`}),` is required. Without full history, git cannot compute the merge base for the three-dot range, and the scan fails.`]})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`43`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`43`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`agentgg`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` pull_request`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`permissions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` contents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`read`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`jobs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` scan`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`github.event.pull_request.head.repo.full_name == github.repository`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` runs-on`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ubuntu-latest`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` steps`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Check out the pull request head`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/checkout@v4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` ref`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ github.event.pull_request.head.sha }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` fetch-depth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Set up Node.js`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/setup-node@v4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` node-version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"20\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Install agentgg`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`npm install -g agentgg`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Scan the pull request diff`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` ANTHROPIC_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"${{ secrets.ANTHROPIC_API_KEY }}\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`|`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` agentgg scan . \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:' --diff \"origin/${{ github.event.pull_request.base.ref }}...${{ github.event.pull_request.head.sha }}\" \\\\'})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` -o ./scan-results \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --provider anthropic \\\\`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` --api-key \"$ANTHROPIC_API_KEY\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` - `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Upload the findings`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`always()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` uses`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`actions/upload-artifact@v4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`agentgg-findings`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:` path`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`scan-results`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`what-to-expect`,children:`What to expect`}),`\n`,_jsxs(_components.p,{children:[`The job uploads `,_jsx(_components.code,{children:`scan-results`}),` as a build artifact on every run, pass or fail. Download it from the workflow run page to read `,_jsx(_components.code,{children:`summary.md`}),` and the per-finding files under `,_jsx(_components.code,{children:`findings/`}),`. See `,_jsx(_components.a,{href:`/cli/resume-and-reports`,children:`Resume and reports`}),` for their shape.`]}),`\n`,_jsx(_components.p,{children:`A pull request from a fork skips the job. No scan runs and nothing uploads for it.`}),`\n`,_jsxs(_components.p,{children:[`Full flag list: `,_jsx(_components.a,{href:`/cli/reference/scan-flags`,children:`Scan flags`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Run agentgg in GitHub Actions","description":"Scan every pull request automatically, restricted to the files it changed, with one workflow file.","href":"/cli/guides/github-actions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Add a provider secret","slug":"add-a-provider-secret","depth":2,"children":[]},{"title":"The workflow file","slug":"the-workflow-file","depth":2,"children":[]},{"title":"What to expect","slug":"what-to-expect","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"agent-gg","siteName":"AgentGG","title":"Run agentgg in GitHub Actions - AgentGG","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-27T19:14:33.678Z","originalFileLocation":"cli/guides/github-actions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Scan every pull request automatically, restricted to the files it changed, with one workflow file.\">\u003cmeta data-mint-head name=\"application-name\" content=\"AgentGG\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Run agentgg in GitHub Actions - AgentGG\">\u003cmeta data-mint-head property=\"og:description\" content=\"Scan every pull request automatically, restricted to the files it changed, with one workflow file.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AgentGG\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.agentgg.dev/cli/guides/github-actions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://agent-gg.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Run+agentgg+in+GitHub+Actions\u0026amp;description=Scan+every+pull+request+automatically%2C+restricted+to+the+files+it+changed%2C+with+one+workflow+file.\u0026amp;theme=7c559b40121ad98d9d95f64a\u0026amp;signature=9f69c2b252c44f1f5e669626b2b4f38c21664bd6339e88fd525747a9b1bacb9c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Run agentgg in GitHub Actions - AgentGG\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Scan every pull request automatically, restricted to the files it changed, with one workflow file.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://agent-gg.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Run+agentgg+in+GitHub+Actions\u0026amp;description=Scan+every+pull+request+automatically%2C+restricted+to+the+files+it+changed%2C+with+one+workflow+file.\u0026amp;theme=7c559b40121ad98d9d95f64a\u0026amp;signature=9f69c2b252c44f1f5e669626b2b4f38c21664bd6339e88fd525747a9b1bacb9c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/agent-gg/H-TXLNoliVMhz_ya/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AgentGG\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff8c42\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.agentgg.dev/cli/guides/github-actions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cli/guides/github-actions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.agentgg.dev/#organization\",\"name\":\"AgentGG\",\"url\":\"https://docs.agentgg.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/agent-gg/98PlcJv2abehqhSS/images/logo-wordmark-light.png?fit=max\u0026auto=format\u0026n=98PlcJv2abehqhSS\u0026q=85\u0026s=fc389901d63eb050a08135dcc324f948\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.agentgg.dev#website\",\"name\":\"AgentGG\",\"url\":\"https://docs.agentgg.dev\",\"publisher\":{\"@id\":\"https://docs.agentgg.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.agentgg.dev/cli/guides/github-actions#webpage\",\"url\":\"https://docs.agentgg.dev/cli/guides/github-actions\",\"name\":\"Run agentgg in GitHub Actions\",\"description\":\"Scan every pull request automatically, restricted to the files it changed, with one workflow file.\",\"dateModified\":\"2026-08-27T19:14:33.678Z\",\"isPartOf\":{\"@id\":\"https://docs.agentgg.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.agentgg.dev/cli/guides/github-actions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.agentgg.dev/cli/guides/github-actions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.agentgg.dev/cli/guides/scan-a-pull-request\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run agentgg in GitHub Actions\",\"item\":\"https://docs.agentgg.dev/cli/guides/github-actions\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.agentgg.dev/cli/guides/github-actions#article\",\"headline\":\"Run agentgg in GitHub Actions\",\"name\":\"Run agentgg in GitHub Actions\",\"description\":\"Scan every pull request automatically, restricted to the files it changed, with one workflow file.\",\"url\":\"https://docs.agentgg.dev/cli/guides/github-actions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.agentgg.dev/cli/guides/github-actions#webpage\"},\"dateModified\":\"2026-08-27T19:14:33.678Z\",\"publisher\":{\"@id\":\"https://docs.agentgg.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.agentgg.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AgentGG\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"AgentGG\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/cli/guides/github-actions.md","siteName":"AgentGG","nav":{"global":null,"anchors":[{"anchor":"Platform","icon":"cloud","pages":[{"title":"Platform","href":"/platform/overview"}]},{"anchor":"CLI","icon":"terminal","groups":[{"group":"Get started","pages":[{"title":"Overview","href":"/cli/overview"},{"title":"Install","href":"/cli/install"},{"title":"Quickstart","href":"/cli/quickstart"},{"title":"Output and state","href":"/cli/output-and-state"}]},{"group":"Concepts","pages":[{"title":"How a scan runs","href":"/cli/how-a-scan-runs"},{"title":"Resume and reports","href":"/cli/resume-and-reports"}]},{"group":"Guides","pages":[{"title":"Scan a pull request","href":"/cli/guides/scan-a-pull-request"},{"title":"Choose agents","href":"/cli/guides/choose-agents"},{"title":"Validate findings and set scope","href":"/cli/guides/validation-and-scope"},{"title":"Test findings against a running app","href":"/cli/guides/live-validation"},{"title":"Suggested fixes","href":"/cli/guides/suggested-fixes"},{"title":"Limit what gets scanned","href":"/cli/guides/limit-what-gets-scanned"},{"title":"Plan a scan and inspect results","description":"Preview which agents would run before you pay for a scan, then read or browse the results without another scan.","href":"/cli/guides/plan-and-inspect"},{"title":"Run agentgg in GitHub Actions","href":"/cli/guides/github-actions"}]},{"group":"Providers","pages":[{"title":"Providers","description":"Set up any of six model providers, or pass a one-off credential for a single scan.","href":"/cli/providers"}]},{"group":"Reference","pages":[{"title":"Commands","href":"/cli/reference/commands"},{"title":"Scan flags","href":"/cli/reference/scan-flags"},{"title":"Configuration","href":"/cli/reference/configuration"}]},{"group":"Help","pages":[{"title":"Troubleshooting","href":"/cli/troubleshooting"}]}]},{"anchor":"Agents","icon":"file-code","pages":[{"title":"Agents","href":"/agents/overview"}]}]},"basePath":"","title":"Run agentgg in GitHub Actions - AgentGG","deploymentId":"dpl_EtLmMeZHkKGqAjV1DiX4ZXCriDj3","buildId":"dpl_EtLmMeZHkKGqAjV1DiX4ZXCriDj3","dynamics":[],"chunks":[]}