„Abhängigkeitsüberprüfungsaktion“ bezieht sich auf die spezifische Aktion, die Unterschiede in einem Pull Request innerhalb des GitHub Actions-Kontext melden kann. Es kann auch Mechanismen zur Erzwingung in den GitHub Actions workflow integrieren. Weitere Informationen finden Sie unter Informationen zur Abhängigkeitsüberprüfung.
Eine Liste gängiger Konfigurationsoptionen findest du unter Abhängigkeitsüberprüfung der GitHub Marketplace.
Konfigurieren des Abhängigkeitsüberprüfungsaktion
Es gibt zwei Methoden zum Konfigurieren des Abhängigkeitsüberprüfungsaktion:
- Inlinekonfiguration der Konfigurationsoptionen in deiner Workflowdatei
- Verweis auf eine Konfigurationsdatei in deiner Workflowdatei
Beachte, dass in allen Beispielen anstelle der SemVer-Versionsnummer (z. B. v3) eine kurze Versionsnummer für die Aktion verwendet wird (v3.0.8). Dadurch wird sichergestellt, dass du die neueste Nebenversion der Aktion verwendest.
Einrichten des Abhängigkeitsüberprüfungsaktion mithilfe der Inlinekonfiguration
-
Füge deinem Ordner
.github/workflowseinen neuen YAML-Workflow hinzu.Für
runs-onlautet die Standardbezeichnungself-hosted. Du kannst die Standardbezeichnung durch die Bezeichnung für einen beliebigen deiner Runner ersetzen.YAML name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: [self-hosted] steps: - name: 'Checkout Repository' uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: [self-hosted] steps: - name: 'Checkout Repository' uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4 -
Lege die Einstellungen fest.
Diese Beispieldatei für den Abhängigkeitsüberprüfungsaktion veranschaulicht, wie du die verfügbaren Konfigurationsoptionen verwenden kannst.
YAML name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: [self-hosted] steps: - name: 'Checkout Repository' uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4 with: # Possible values: "critical", "high", "moderate", "low" fail-on-severity: critical # ([String]). Skip these GitHub Advisory Database IDs during detection (optional) # Possible values: Any valid GitHub Advisory Database ID from https://github.com/advisories allow-ghsas: GHSA-abcd-1234-5679, GHSA-efgh-1234-5679 # ([String]). Block pull requests that introduce vulnerabilities in the scopes that match this list (optional) # Possible values: "development", "runtime", "unknown" fail-on-scopes: development, runtimename: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: [self-hosted] steps: - name: 'Checkout Repository' uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4 with: # Possible values: "critical", "high", "moderate", "low" fail-on-severity: critical # ([String]). Skip these GitHub Advisory Database IDs during detection (optional) # Possible values: Any valid GitHub Advisory Database ID from https://github.com/advisories allow-ghsas: GHSA-abcd-1234-5679, GHSA-efgh-1234-5679 # ([String]). Block pull requests that introduce vulnerabilities in the scopes that match this list (optional) # Possible values: "development", "runtime", "unknown" fail-on-scopes: development, runtime
Einrichten des Abhängigkeitsüberprüfungsaktion mithilfe einer Konfigurationsdatei
-
Füge deinem Ordner
.github/workflowseinen neuen YAML-Workflow hinzu, und gib mithilfe vonconfig-filean, dass du eine Konfigurationsdatei verwendest.Für
runs-onlautet die Standardbezeichnungself-hosted. Du kannst die Standardbezeichnung durch die Bezeichnung für einen beliebigen deiner Runner ersetzen.YAML name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: [self-hosted] steps: - name: 'Checkout Repository' uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4 with: # ([String]). Representing a path to a configuration file local to the repository or in an external repository. # Possible values: An absolute path to a local file or an external file. config-file: './.github/dependency-review-config.yml' # Optional alternative syntax for an external file: OWNER/REPOSITORY/FILENAME@BRANCH (uncomment if preferred) # config-file: 'github/octorepo/dependency-review-config.yml@main' # ([Token]) Use if your configuration file resides in a private external repository. # Possible values: Any GitHub token with read access to the private external repository. external-repo-token: 'ghp_123456789abcde'name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: [self-hosted] steps: - name: 'Checkout Repository' uses: actions/checkout@v5 - name: Dependency Review uses: actions/dependency-review-action@v4 with: # ([String]). Representing a path to a configuration file local to the repository or in an external repository. # Possible values: An absolute path to a local file or an external file. config-file: './.github/dependency-review-config.yml' # Optional alternative syntax for an external file: OWNER/REPOSITORY/FILENAME@BRANCH (uncomment if preferred) # config-file: 'github/octorepo/dependency-review-config.yml@main' # ([Token]) Use if your configuration file resides in a private external repository. # Possible values: Any GitHub token with read access to the private external repository. external-repo-token: 'ghp_123456789abcde' -
Erstelle die Konfigurationsdatei in dem von dir angegebenen Pfad.
Diese YAML-Beispieldatei veranschaulicht, wie du die verfügbaren Konfigurationsoptionen verwenden kannst.
YAML # Possible values: "critical", "high", "moderate", "low" fail-on-severity: critical # ([String]). Skip these GitHub Advisory Database IDs during detection (optional) # Possible values: Any valid GitHub Advisory Database ID from https://github.com/advisories allow-ghsas: - GHSA-abcd-1234-5679 - GHSA-efgh-1234-5679 # ([String]). Block pull requests that introduce vulnerabilities in the scopes that match this list (optional) # Possible values: "development", "runtime", "unknown" fail-on-scopes: - development - runtime# Possible values: "critical", "high", "moderate", "low" fail-on-severity: critical # ([String]). Skip these GitHub Advisory Database IDs during detection (optional) # Possible values: Any valid GitHub Advisory Database ID from https://github.com/advisories allow-ghsas: - GHSA-abcd-1234-5679 - GHSA-efgh-1234-5679 # ([String]). Block pull requests that introduce vulnerabilities in the scopes that match this list (optional) # Possible values: "development", "runtime", "unknown" fail-on-scopes: - development - runtime
Weitere Einzelheiten zu den Konfigurationsoptionen findest du unter dependency-review-action.
Weiterführende Lektüre
-
[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/customizing-your-dependency-review-action-configuration)