From 54fe55d8c7221d66aaefb68aee5aa60a9afe7c56 Mon Sep 17 00:00:00 2001 From: fraxken Date: Fri, 3 Jan 2025 15:29:49 +0100 Subject: [PATCH] ci: add Node.js test workflow + auto-merge for dependabot --- .github/workflows/nodejs.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/nodejs.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..44c141d --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,46 @@ +name: Node.js CI + +on: + push: + branches: main + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [22.x] + fail-fast: false + steps: + - name: Harden Runner + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v2.6.0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm install + - name: Run tests + run: npm run test + automerge: + if: > + github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' + needs: + - test + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Merge Dependabot PR + uses: fastify/github-action-merge-dependabot@c3bde0759d4f24db16f7b250b2122bc2df57e817 # v3.11.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file