-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add "Composer audit" starter workflows & metadata #3345
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
Open
tangrufus
wants to merge
1
commit into
actions:main
Choose a base branch
from
tangrufus:composer-audit-to-sarif-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+71
−0
Open
Changes from all commits
Commits
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
Some comments aren't visible on the classic Files Changed page.
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,60 @@ | ||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
| # | ||
| # ******** NOTE ******** | ||
| # If you do not commit composer.lock or require package installations before auditing: | ||
| # | ||
| # 1. Set up appropriate `php-version` | ||
| # 2. Run `$ composer install` (with `COMPOSER_AUTH` if applicable) | ||
| # 3. Run `$ composer audit` without the `--locked` flag | ||
| # | ||
| # See: https://github.com/typisttech/composer-audit-to-sarif-action#audit-based-on-installed-packages | ||
|
|
||
| name: Composer audit | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ $default-branch, $protected-branches ] | ||
| pull_request: | ||
| # The branches below must be a subset of the branches above | ||
| branches: [ $default-branch ] | ||
| schedule: | ||
| - cron: $cron-weekly | ||
|
|
||
| permissions: | ||
| contents: read # for actions/checkout to fetch code | ||
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
|
|
||
| jobs: | ||
| composer-audit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| composer.json | ||
| composer.lock | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2.37.2 | ||
| with: | ||
| php-version: latest | ||
| coverage: none | ||
|
|
||
| - run: composer audit --locked --format json > audit.json | ||
| continue-on-error: true | ||
| # env: | ||
| # COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} # if applicable | ||
|
|
||
| - uses: typisttech/composer-audit-to-sarif-action@b92b7e7b6e54c84918cf6a5e8ffe8058d6749f9e #v0.1.4 | ||
| id: comsarif | ||
| with: | ||
| audit: audit.json | ||
|
|
||
| - uses: github/codeql-action/upload-sarif@v4 | ||
| with: | ||
| sarif_file: ${{ steps.comsarif.outputs.sarif }} |
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,11 @@ | ||
| { | ||
| "name": "Composer audit", | ||
| "description": "Upload Composer audit reports as code scanning alerts", | ||
| "iconName": "php", | ||
| "creator": "Typist Tech Limited", | ||
| "categories": [ | ||
| "Code Scanning", | ||
| "PHP", | ||
| "Composer" | ||
| ] | ||
| } | ||
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.