diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..410f9b4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,23 @@ +# 每月一次,每个生态合成一个 PR(Refs ModAVD/ModAVD#127)。 +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + cooldown: + default-days: 7 + groups: + github-actions: + patterns: + - "*" + - package-ecosystem: npm + directory: / + schedule: + interval: monthly + cooldown: + default-days: 7 + groups: + npm: + patterns: + - "*" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4e8cfff..8d10825 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,6 +2,9 @@ name: Check on: pull_request: + push: + branches: [main] + merge_group: workflow_dispatch: permissions: @@ -50,4 +53,27 @@ jobs: echo "::error file=scripts/privacy.py::scripts/privacy.py differs from ModAVD/ModAVD main. The scanner is changed in ModAVD first; copy its scripts/privacy.py here byte for byte (only privacy-allowlist.json is this repository's own)." exit 1 fi - echo "scripts/privacy.py is the same as ModAVD/ModAVD main $(git -C .modavd rev-parse --short HEAD)" \ No newline at end of file + echo "scripts/privacy.py is the same as ModAVD/ModAVD main $(git -C .modavd rev-parse --short HEAD)" + + zizmor: + name: Workflow security (zizmor) + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - name: Checkout without persistent credentials + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Install zizmor 1.32.0 (version and wheel hash pinned) + shell: bash + run: | + set -euo pipefail + python3 -m venv "$RUNNER_TEMP/zizmor" + printf '%s\n' 'zizmor==1.32.0 --hash=sha256:84a6acb975accc13408786a2bd274b572537ca19c933ebbc13e78f3988562071' > "$RUNNER_TEMP/zizmor-requirements.txt" + "$RUNNER_TEMP/zizmor/bin/pip" install --quiet --disable-pip-version-check --no-deps --only-binary=:all: \ + --require-hashes -r "$RUNNER_TEMP/zizmor-requirements.txt" + - name: Audit workflows and Dependabot config + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: '"$RUNNER_TEMP/zizmor/bin/zizmor" --format=github --no-progress .'