name: dependency review
on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  dependency-review:
    runs-on: ubuntu-latest
    steps:
      - name: checkout repository
        uses: actions/checkout@v7
      - name: dependency review
        uses: actions/dependency-review-action@v5
        continue-on-error: ${{ github.event_name == 'push' }}
      - name: check dependency review outcome
        if: github.event_name == 'push' && failure()
        run: |
          echo "::warning::Dependency review failed. Please check the dependencies for potential issues."
