From 7af693dfffa5ed816931801c344084a07c20528d Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 7 Nov 2024 08:35:05 -0300 Subject: [PATCH] ci: auto-merge dependabot when build succeeds --- .github/workflows/ansi.yml | 18 ++++++++++++++++++ .github/workflows/cellbuf.yml | 18 ++++++++++++++++++ .github/workflows/colors.yml | 18 ++++++++++++++++++ .github/workflows/conpty.yml | 18 ++++++++++++++++++ .github/workflows/editor.yml | 18 ++++++++++++++++++ .github/workflows/errors.yml | 18 ++++++++++++++++++ .github/workflows/examples.yml | 18 ++++++++++++++++++ .github/workflows/golden.yml | 18 ++++++++++++++++++ .github/workflows/higherorder.yml | 18 ++++++++++++++++++ .github/workflows/input.yml | 18 ++++++++++++++++++ .github/workflows/json.yml | 18 ++++++++++++++++++ .github/workflows/maps.yml | 18 ++++++++++++++++++ .github/workflows/open.yml | 18 ++++++++++++++++++ .github/workflows/ordered.yml | 18 ++++++++++++++++++ .github/workflows/slice.yml | 18 ++++++++++++++++++ .github/workflows/sshkey.yml | 18 ++++++++++++++++++ .github/workflows/strings.yml | 18 ++++++++++++++++++ .github/workflows/teatest-v2.yml | 18 ++++++++++++++++++ .github/workflows/teatest.yml | 18 ++++++++++++++++++ .github/workflows/term.yml | 18 ++++++++++++++++++ .github/workflows/termios.yml | 18 ++++++++++++++++++ .github/workflows/wcwidth.yml | 18 ++++++++++++++++++ .github/workflows/windows.yml | 18 ++++++++++++++++++ .github/workflows/xpty.yml | 18 ++++++++++++++++++ scripts/builds | 20 +++++++++++++++++++- 25 files changed, 451 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ansi.yml b/.github/workflows/ansi.yml index 50abb405..1f83b420 100644 --- a/.github/workflows/ansi.yml +++ b/.github/workflows/ansi.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./ansi/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/cellbuf.yml b/.github/workflows/cellbuf.yml index f9d28081..8f07b6b6 100644 --- a/.github/workflows/cellbuf.yml +++ b/.github/workflows/cellbuf.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./cellbuf/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/colors.yml b/.github/workflows/colors.yml index a717832b..f8db928b 100644 --- a/.github/workflows/colors.yml +++ b/.github/workflows/colors.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./colors/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/conpty.yml b/.github/workflows/conpty.yml index 73b775d8..3fa413ea 100644 --- a/.github/workflows/conpty.yml +++ b/.github/workflows/conpty.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./conpty/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/editor.yml b/.github/workflows/editor.yml index 0e7506d4..293dceec 100644 --- a/.github/workflows/editor.yml +++ b/.github/workflows/editor.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./editor/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/errors.yml b/.github/workflows/errors.yml index c3bc8d00..19c3ee27 100644 --- a/.github/workflows/errors.yml +++ b/.github/workflows/errors.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./errors/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 4668ef3c..91fbf48c 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./examples/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/golden.yml b/.github/workflows/golden.yml index 0cc1ba8c..86c87485 100644 --- a/.github/workflows/golden.yml +++ b/.github/workflows/golden.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/golden/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/higherorder.yml b/.github/workflows/higherorder.yml index 99843f35..00af8f11 100644 --- a/.github/workflows/higherorder.yml +++ b/.github/workflows/higherorder.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/higherorder/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/input.yml b/.github/workflows/input.yml index 8714972e..aa3b9566 100644 --- a/.github/workflows/input.yml +++ b/.github/workflows/input.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./input/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/json.yml b/.github/workflows/json.yml index fa0f147b..73fd41ff 100644 --- a/.github/workflows/json.yml +++ b/.github/workflows/json.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./json/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/maps.yml b/.github/workflows/maps.yml index fb821069..72108362 100644 --- a/.github/workflows/maps.yml +++ b/.github/workflows/maps.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/maps/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/open.yml b/.github/workflows/open.yml index 917aae54..ae90fd05 100644 --- a/.github/workflows/open.yml +++ b/.github/workflows/open.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/open/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/ordered.yml b/.github/workflows/ordered.yml index 0c6ac881..e46014b8 100644 --- a/.github/workflows/ordered.yml +++ b/.github/workflows/ordered.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/ordered/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/slice.yml b/.github/workflows/slice.yml index 9d9d7f5d..d88a337e 100644 --- a/.github/workflows/slice.yml +++ b/.github/workflows/slice.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/slice/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/sshkey.yml b/.github/workflows/sshkey.yml index 395273e6..068e056b 100644 --- a/.github/workflows/sshkey.yml +++ b/.github/workflows/sshkey.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./sshkey/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/strings.yml b/.github/workflows/strings.yml index c963b406..7bc9ad92 100644 --- a/.github/workflows/strings.yml +++ b/.github/workflows/strings.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/strings/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/teatest-v2.yml b/.github/workflows/teatest-v2.yml index ee517619..d11c3d16 100644 --- a/.github/workflows/teatest-v2.yml +++ b/.github/workflows/teatest-v2.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/teatest/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/teatest.yml b/.github/workflows/teatest.yml index fbcd0398..ff955ca0 100644 --- a/.github/workflows/teatest.yml +++ b/.github/workflows/teatest.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./exp/teatest/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/term.yml b/.github/workflows/term.yml index e687c409..f1f248b2 100644 --- a/.github/workflows/term.yml +++ b/.github/workflows/term.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./term/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/termios.yml b/.github/workflows/termios.yml index c55c8905..e9b4cfff 100644 --- a/.github/workflows/termios.yml +++ b/.github/workflows/termios.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./termios/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/wcwidth.yml b/.github/workflows/wcwidth.yml index ce9beec9..59cabce5 100644 --- a/.github/workflows/wcwidth.yml +++ b/.github/workflows/wcwidth.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./wcwidth/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ee80fdb5..9f298737 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./windows/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/xpty.yml b/.github/workflows/xpty.yml index b8addc67..4584e18e 100644 --- a/.github/workflows/xpty.yml +++ b/.github/workflows/xpty.yml @@ -28,3 +28,21 @@ jobs: cache-dependency-path: ./xpty/go.sum - run: go build -v ./... - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - run: | + gh pr review --approve "$PR_URL" + gh pr merge --squash --auto "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/scripts/builds b/scripts/builds index aa2b5702..3a6db728 100755 --- a/scripts/builds +++ b/scripts/builds @@ -41,5 +41,23 @@ jobs: cache: true cache-dependency-path: $sum - run: go build -v ./... - - run: go test -race -v ./..." >"./.github/workflows/${name}.yml" + - run: go test -race -v ./... + dependabot: + needs: [build] + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + if: \${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} + steps: + - id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: \"\${{ secrets.GITHUB_TOKEN }}\" + - run: | + gh pr review --approve \"\$PR_URL\" + gh pr merge --squash --auto \"\$PR_URL\" + env: + PR_URL: \${{github.event.pull_request.html_url}} + GITHUB_TOKEN: \${{secrets.GITHUB_TOKEN}}" >"./.github/workflows/${name}.yml" done