-
Notifications
You must be signed in to change notification settings - Fork 0
feat: investigate Dependabot security alerts #35
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b917278
feat: investigate Dependabot security alerts
groovecoder 126e8d4
feat: auto-dismiss non-affected alerts and post summary report
groovecoder 38597a2
fix: address PR #35 review feedback
groovecoder 8c49464
fix: generate HTML summary report with code snippets
groovecoder 8752094
refactor: extract HTML report into scripts/alert_report.py
groovecoder 2dbe2dd
fix: move actions:write permission to job level
groovecoder 581e87d
fix: redact affected alert reports for public artifact safety
groovecoder d742b39
fix: block auto-dismiss for high/critical severity alerts
groovecoder 5c9f43d
fix: extract verdict from Claude text output
groovecoder 5cc18eb
feat: step summaries, bump PRs, and deduplication
groovecoder ca285eb
refactor: address PR #35 review comments
groovecoder 846234d
feat: enrich fix prompt with investigation verdict
groovecoder 00ced7c
fix: filter open alerts server-side in investigate-all-alerts
groovecoder 4c20cc2
fix: include hidden files in verdict artifact upload
groovecoder d1045ac
merge: resolve conflicts with main
groovecoder 1b572be
style: ruff format post_alert_action.py
groovecoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| --- | ||
| name: Setup target repo | ||
| description: >- | ||
| Parse target repo, create app token, checkout, read config, and install | ||
| Python. Shared by investigate, fix, and setup workflows. | ||
|
|
||
| inputs: | ||
| target-repo: | ||
| description: 'Target repo (e.g. mozilla/fx-private-relay)' | ||
| required: true | ||
| app-id: | ||
| description: 'GitHub App ID for token creation' | ||
| required: true | ||
| private-key: | ||
| description: 'GitHub App private key' | ||
| required: true | ||
| blender-workspace: | ||
| description: 'Path to blender checkout (github.workspace)' | ||
| required: true | ||
| permission-contents: | ||
| description: 'Token permission for contents (omit to inherit all)' | ||
| default: '' | ||
| permission-pull-requests: | ||
| description: 'Token permission for pull-requests (omit to inherit all)' | ||
| default: '' | ||
| permission-vulnerability-alerts: | ||
| description: 'Token permission for vulnerability-alerts (omit to inherit all)' | ||
| default: '' | ||
| permission-security-events: | ||
| description: 'Token permission for security-events (omit to inherit all)' | ||
| default: '' | ||
| checkout-path: | ||
| description: 'Path to checkout target repo' | ||
| default: 'target' | ||
| checkout-submodules: | ||
| description: 'Submodules mode (false, true, or recursive)' | ||
| default: 'false' | ||
| checkout-persist-credentials: | ||
| description: 'Persist credentials after checkout' | ||
| default: 'false' | ||
| install-sandbox: | ||
| description: 'Install bubblewrap + socat' | ||
| default: 'false' | ||
| install-claude: | ||
| description: 'Install Claude Code CLI' | ||
| default: 'false' | ||
| install-blender-deps: | ||
| description: 'Install BLEnder Python dependencies' | ||
| default: 'false' | ||
|
|
||
| outputs: | ||
| token: | ||
| description: 'GitHub App token for target repo' | ||
| value: ${{ steps.app-token.outputs.token }} | ||
| owner: | ||
| description: 'Target repo owner' | ||
| value: ${{ steps.parse.outputs.owner }} | ||
| name: | ||
| description: 'Target repo name' | ||
| value: ${{ steps.parse.outputs.name }} | ||
| node_version: | ||
| description: 'Node version from blender.yml' | ||
| value: ${{ steps.config.outputs.node_version }} | ||
| python_version: | ||
| description: 'Python version from blender.yml' | ||
| value: ${{ steps.config.outputs.python_version }} | ||
| install_command: | ||
| description: 'Install command from blender.yml' | ||
| value: ${{ steps.config.outputs.install_command }} | ||
| repo_name: | ||
| description: 'Display name from blender.yml' | ||
| value: ${{ steps.config.outputs.repo_name }} | ||
| dismiss_unaffected: | ||
| description: 'Whether to dismiss unaffected alerts' | ||
| value: ${{ steps.config.outputs.dismiss_unaffected }} | ||
| install_failed: | ||
| description: 'Whether the target dependency install failed' | ||
| value: ${{ steps.install-deps.outcome == 'failure' && 'true' || 'false' }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Parse target repo | ||
| id: parse | ||
| shell: bash | ||
| run: | | ||
| echo "owner=${TARGET_REPO%%/*}" >> "$GITHUB_OUTPUT" | ||
| echo "name=${TARGET_REPO##*/}" >> "$GITHUB_OUTPUT" | ||
| env: | ||
| TARGET_REPO: ${{ inputs.target-repo }} | ||
|
|
||
| - id: app-token | ||
| uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2 | ||
| with: | ||
| app-id: ${{ inputs.app-id }} | ||
| private-key: ${{ inputs.private-key }} | ||
| owner: ${{ steps.parse.outputs.owner }} | ||
| repositories: ${{ steps.parse.outputs.name }} | ||
| permission-contents: ${{ inputs.permission-contents || '' }} | ||
| permission-pull-requests: ${{ inputs.permission-pull-requests || '' }} | ||
| permission-vulnerability-alerts: ${{ inputs.permission-vulnerability-alerts || '' }} | ||
| permission-security-events: ${{ inputs.permission-security-events || '' }} | ||
|
|
||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| repository: ${{ inputs.target-repo }} | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| path: ${{ inputs.checkout-path }} | ||
| submodules: ${{ inputs.checkout-submodules }} | ||
| persist-credentials: ${{ inputs.checkout-persist-credentials }} | ||
|
|
||
| - name: Read repo config | ||
| id: config | ||
| shell: bash | ||
| run: | | ||
| CONFIG_FILE="${CHECKOUT_PATH}/.blender/blender.yml" | ||
| if [ ! -f "$CONFIG_FILE" ]; then | ||
| echo "Error: No config found at $CONFIG_FILE" | ||
| exit 1 | ||
| fi | ||
| { | ||
| echo "node_version=$(yq '.node_version // ""' "$CONFIG_FILE")" | ||
| echo "python_version=$(yq '.python_version // ""' "$CONFIG_FILE")" | ||
| echo "install_command=$(yq '.install_command // ""' "$CONFIG_FILE")" | ||
| echo "repo_name=$(yq '.repo_name // ""' "$CONFIG_FILE")" | ||
| echo "dismiss_unaffected=$(yq '.investigate.dismiss_unaffected // "false"' "$CONFIG_FILE")" | ||
| } >> "$GITHUB_OUTPUT" | ||
| env: | ||
| CHECKOUT_PATH: ${{ inputs.checkout-path }} | ||
|
|
||
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | ||
| with: | ||
| python-version: ${{ steps.config.outputs.python_version || '3.11' }} | ||
| cache: pip | ||
|
|
||
| - name: Install BLEnder Python dependencies | ||
| if: inputs.install-blender-deps == 'true' | ||
| shell: bash | ||
| run: pip install -r scripts/requirements.txt | ||
| working-directory: ${{ inputs.blender-workspace }} | ||
|
|
||
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | ||
| if: steps.config.outputs.node_version != '' | ||
| with: | ||
| node-version: ${{ steps.config.outputs.node_version }} | ||
|
|
||
| - name: Install target dependencies | ||
| id: install-deps | ||
| if: steps.config.outputs.install_command != '' | ||
| continue-on-error: true | ||
| shell: bash | ||
| working-directory: ${{ inputs.checkout-path }} | ||
| run: | | ||
| eval "$INSTALL_COMMAND" 2>&1 | tee /tmp/install-output.log | ||
| env: | ||
| INSTALL_COMMAND: ${{ steps.config.outputs.install_command }} | ||
|
|
||
| - name: Install sandbox dependencies | ||
| if: inputs.install-sandbox == 'true' | ||
| shell: bash | ||
| run: sudo apt-get install -y bubblewrap socat | ||
|
|
||
| - name: Install Claude Code | ||
| if: inputs.install-claude == 'true' | ||
| shell: bash | ||
| run: npm install -g @anthropic-ai/claude-code@stable | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.