You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/claude_code.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,15 @@ When the `@claude` handle is mentioned in the title of a SmartFix-created GitHub
22
22
23
23
***Contrast Assess:** You need an active Contrast Assess deployment identifying vulnerabilities in your application.
24
24
***GitHub:** Your project must be hosted on GitHub and use GitHub Actions. In the GitHub repository's Settings, enable the Actions > General > Workflow Permissions checkbox for "Allow GitHub Actions to create and approve pull requests".
25
+
***Claude Code Requirements:**
26
+
* GitHub repository with **Issues** and **GitHub Copilot** enabled
27
+
* GitHub Personal Access Token (PAT) with:
28
+
*`meta` (read permissions)
29
+
*`actions` (read permissions)
30
+
*`pulls` (read-write permissions)
31
+
*`issues` (read-write permissions)
32
+
***Suggestion:** Set up a GitHub service account and use that to make the PAT for more explicit tracking of SmartFix's work in GitHub.
25
33
***Contrast API Credentials:** You will need your Contrast Host, Organization ID, Application ID, Authorization Key, and API Key.
26
-
***GitHub Token Permissions:** The GitHub token must have `contents: write` and `pull-requests: write` permissions. These permissions must be explicitly set in your workflow file. Note, SmartFix uses the internal GitHub token for Actions; you do not need to create a Personal Access Token (PAT).
27
34
***LLM Access:** Ensure that you have access to one of our recommended LLMs for use with SmartFix. If using an AWS Bedrock model, please see Amazon's User Guide on [model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html).
28
35
29
36
Set the gathered values as secrets and variables for the GitHub repository at Settings tab > Secrets and Variables in the sidebar > Actions.
@@ -54,10 +61,6 @@ on:
54
61
- cron: '0 0 * * *' # Runs daily at midnight UTC, adjust as needed
55
62
workflow_dispatch: # Allows manual triggering
56
63
57
-
permissions:
58
-
contents: write
59
-
pull-requests: write
60
-
61
64
jobs:
62
65
generate_fixes:
63
66
name: Generate Fixes
@@ -82,18 +85,17 @@ jobs:
82
85
contrast_api_key: ${{ secrets.CONTRAST_API_KEY }}
83
86
84
87
# GitHub Configuration
85
-
github_token: ${{ secrets.PAT_TOKEN }} # Necessary for creating Issues and mentioning Claude Code (@claude). This token should have read permission for metadata and read-write permission for issues and pulls. A best practice is to have an GitHub Organization service account create the PAT (an Organization admin may need to approve it)
88
+
github_token: ${{ secrets.PAT_TOKEN }} # Necessary for creating Issues and mentioning Claude Code (@claude). This token should have read permission for metadata, read permissions on actions and read-write permission for issues and pulls. A best practice is to have an GitHub Organization service account create the PAT (an Organization admin may need to approve it)
86
89
base_branch: '${{ github.event.repository.default_branch }}' # This will default to your repo default branch (other common base branches are 'main', 'master' or 'develop')
87
90
coding_agent: 'CLAUDE_CODE' # Specify the use of Claude Code instead of the default SmartFix internal coding agent
88
91
89
92
# Other Optional Inputs (see action.yml for defaults and more options)
90
-
# formatting_command: 'mvn spotless:apply' # Or the command appropriate for your project to correct the formatting of SmartFix's changes. This ensures that SmartFix follows your coding standards.
91
93
# max_open_prs: 5 # This is the maximum limit for the number of PRs that SmartFix will have open at single time
* Store all sensitive values (API keys, tokens) as GitHub Secrets in your repository or Github organization settings.
147
149
* Replace `v1` with the specific version of the SmartFix GitHub Action you intend to use.
148
150
* The `contrast_app_id` must correspond to the Contrast Application ID for the code in the repository where this action runs. To find the app ID, visit the application page in the Contrast web UI, then use the last UUID in the URL (immediately after `/applications/`) as the app ID value.
149
-
* Set the `coding_agent` value to `CLAUDE_CODE` to force the SmartFix GitHub Action to use the GitHub Copilot coding agent.
151
+
* Set the `coding_agent` value to `CLAUDE_CODE` to force the SmartFix GitHub Action to use the Claude Code coding agent.
150
152
151
153
### Supported Languages
152
154
@@ -234,7 +236,7 @@ SmartFix collects telemetry data to help improve the service and diagnose issues
234
236
* Ensure the that the repository / organization has GitHub Issues enabled and that the Claude Code GitHub App has been installed on the repository
235
237
* Check the GitHub Action logs for specific error messages from the Claude Code agent.
236
238
***PR Creation Failures:**
237
-
* Ensure the `PAT_token` has the necessary permissions to create and read Issues and PRs in the repository.
239
+
* Ensure the `PAT_token` has the necessary permissions to create and read Actions, Issues and PRs in the repository.
238
240
* Check for branch protection rules that might prevent PR creation.
239
241
***No Fixes Generated:**
240
242
* Confirm there are eligible CRITICAL or HIGH severity vulnerabilities in Contrast Assess for the configured `contrast_app_id`. SmartFix only attempts to fix vulnerabilities that are in the REPORTED state.
Copy file name to clipboardExpand all lines: docs/github_copilot.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ When assigned to a SmartFix-created GitHub Issue describing a Contrast-discovere
28
28
*`meta` (read permissions)
29
29
*`pulls` (read-write permissions)
30
30
*`issues` (read-write permissions)
31
-
***Suggestion:**Setup a GitHub service account and use that to make the PAT for more explicit tracking of SmartFix's work in GitHub.
31
+
***Suggestion:**Set up a GitHub service account and use that to make the PAT for more explicit tracking of SmartFix's work in GitHub.
32
32
***Contrast API Credentials:** You will need your Contrast Host, Organization ID, Application ID, Authorization Key, and API Key.
33
33
34
34
Set the gathered values as secrets and variables for the GitHub repository at Settings tab > Secrets and Variables in the sidebar > Actions.
@@ -59,10 +59,6 @@ on:
59
59
- cron: '0 0 * * *' # Runs daily at midnight UTC, adjust as needed
60
60
workflow_dispatch: # Allows manual triggering
61
61
62
-
permissions:
63
-
contents: write
64
-
pull-requests: write
65
-
66
62
jobs:
67
63
generate_fixes:
68
64
name: Generate Fixes
@@ -91,17 +87,13 @@ jobs:
91
87
base_branch: '${{ github.event.repository.default_branch }}' # This will default to your repo default branch (other common base branches are 'main', 'master' or 'develop')
92
88
coding_agent: 'GITHUB_COPILOT' # Specify the use of GitHub Copilot instead of the default SmartFix internal coding agent
93
89
94
-
# Required Runtime Configuration
95
-
build_command: 'mvn clean install' # Or the build command appropriate for your project. SmartFix will use this command to ensure that its changes work correctly with your project.
96
-
97
90
# Other Optional Inputs (see action.yml for defaults and more options)
98
-
# formatting_command: 'mvn spotless:apply' # Or the command appropriate for your project to correct the formatting of SmartFix's changes. This ensures that SmartFix follows your coding standards.
99
91
# max_open_prs: 5 # This is the maximum limit for the number of PRs that SmartFix will have open at single time
0 commit comments