Skip to content

ci: run osv-linter over advisories #617

ci: run osv-linter over advisories

ci: run osv-linter over advisories #617

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
# Pushing new changes to a branch will cancel any in-progress CI runs of this workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Restrict jobs in this workflow to have no permissions by default; permissions
# should be granted per job as needed using a dedicated `permissions` block
permissions: {}
jobs:
audit:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Audit dependencies for security vulnerabilities
uses: g-rath/check-with-osv-detector@0e8c0f954d8618a3a4671eca1918b30b2d085af3 # v0.2.0
lint:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- run: git clone https://github.com/ossf/osv-schema
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
cache-dependency-path: 'osv-schema/tools/osv-linter/go.sum'
go-version: stable
check-latest: true
- run: go build -o osv-linter ./cmd/osv
working-directory: osv-schema/tools/osv-linter
- run: osv-schema/tools/osv-linter/osv-linter
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
path: drupal-advisory-database
persist-credentials: false
- run: osv-schema/tools/osv-linter/osv-linter record lint drupal-advisory-database/advisories/
ruff:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
version-file: 'pyproject.toml'
args: 'check'
- uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
version-file: 'pyproject.toml'
args: 'format --check --diff'
mypy:
permissions:
contents: read # to fetch (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version-file: '.python-version'
- run: pipx install poetry~=2.0
- run: poetry install
- run: poetry run mypy .
pytest:
permissions:
contents: read # to fetch (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version-file: '.python-version'
- run: pipx install poetry~=2.0
- run: poetry install
- run: poetry run pytest
validate:
permissions:
contents: read # to fetch (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version-file: '.python-version'
- run: pipx install poetry~=2.0
- run: poetry install
- run: poetry run scripts/validate_advisories.py
prettier:
permissions:
contents: read # to fetch (actions/checkout)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
- run: npx prettier --check .