Open
Description
We are not using a pull requests, we tried using it for normal push as follows, however it seems to be not working as we want it to be.
Here is our usecase:
- We want to ensure no one is pushing a code with lib having a licence outside of allowed list of license. If that happens pipeline should fail
- We have collected a list of allowed license approved from a legal department & want to enforce it for all push happening on any pipeline in future.
Here is how my pipeline looks like
`name: Dependency Review
on:
push:
branches:
- main
paths-ignore:
- '.talismanrc'
pull_request:
branches:
- main
permissions:
contents: write
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Dependency Review
uses: actions/dependency-review-action@v4
with:
config-file: './.github/dependency-review-config.yml'
base-ref: ${{ github.event.pull_request.base.sha || github.event.before || github.sha }}
head-ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Show Review Results
run: |
echo "Licenses Denied: ${{ steps.dependency-review.outputs.licenses_denied }}"
echo "Vulnerabilities: ${{ steps.dependency-review.outputs.vulnerabilities }}"
- name: 'Report'
if: ${{ failure() }}
run: |
echo "Review failed. Licenses Denied: ${{ steps.dependency-review.outputs.licenses_denied }}"
echo "Vulnerabilities: ${{ steps.dependency-review.outputs.vulnerabilities }}"`
2 problems i am facing:
- scan the existing licences n highlight if there are any licences not part of allowed list
- even for new code change its not working as we expect for normal push