From aeb6a08fc83f1c693846477fd050e6fa2cb49307 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Tue, 3 Jun 2025 16:54:14 +0400 Subject: [PATCH] build: automatically merge dependendabot changes if they pass ci --- .github/workflows/dependabot-automerge.yml | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/dependabot-automerge.yml diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000..704e160 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,60 @@ +name: Dependabot Automerge + +on: + pull_request_target: + types: [opened, synchronize, reopened] + +permissions: + pull-requests: write + contents: write + checks: read + +jobs: + security-scan: + name: Security Vulnerability Scan + if: ${{ github.actor == 'dependabot[bot]' }} + uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@e69cc6c86b31f1e7e23935bbe7031b50e51082de" # v2.0.2 + with: + scan-args: |- + -r + --skip-git + --lockfile=pnpm-lock.yaml + --lockfile=src-tauri/Cargo.lock + --lockfile=nodecar/pnpm-lock.yaml + ./ + permissions: + security-events: write + contents: read + actions: read + + lint-js: + name: Lint JavaScript/TypeScript + if: ${{ github.actor == 'dependabot[bot]' }} + uses: ./.github/workflows/lint-js.yml + secrets: inherit + + lint-rust: + name: Lint Rust + if: ${{ github.actor == 'dependabot[bot]' }} + uses: ./.github/workflows/lint-rs.yml + secrets: inherit + + dependabot-automerge: + name: Dependabot Automerge + if: ${{ github.actor == 'dependabot[bot]' }} + needs: [security-scan, lint-js, lint-rust] + runs-on: ubuntu-latest + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Auto-merge minor and patch updates + uses: ridedott/merge-me-action@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PRESET: DEPENDABOT_MINOR + MERGE_METHOD: SQUASH + timeout-minutes: 10