From 12685d0ff6e23e8e90ca7add5dfcdcb9a68f893b Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 22 Oct 2022 14:35:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20Automerge=20to=20CI/CD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/integration.yaml | 31 +++++++++++++++++++++++++----- .github/workflows/quality.yaml | 4 ++-- .github/workflows/release.yaml | 4 ++-- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 90523c8..a764755 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -4,19 +4,19 @@ on: push: branches: - main - pull_request_target: + pull_request: jobs: test: name: Test - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - name: Setup go uses: actions/setup-go@v3 with: - go-version: '1.17.x' + go-version: "1.17.x" - name: Cache Go Dependencies uses: actions/cache@v3 @@ -36,7 +36,7 @@ jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 needs: - test steps: @@ -45,7 +45,7 @@ jobs: - name: Setup go uses: actions/setup-go@v3 with: - go-version: '1.17.x' + go-version: "1.17.x" - name: Cache Go Dependencies uses: actions/cache@v3 @@ -62,3 +62,24 @@ jobs: - name: Docker run: docker build . + + automerge: + name: Merge Automatically + needs: [test, build] + runs-on: ubuntu-20.04 + + permissions: + pull-requests: write + contents: write + + steps: + - name: Obtain Access Token + id: acces_token + run: | + TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.SYSTEMLI_APP_CREDENTIALS_TOKEN }})" + echo "token=$TOKEN" >> $GITHUB_OUTPUT + + - name: Merge + uses: fastify/github-action-merge-dependabot@v3 + with: + github-token: ${{ steps.acces_token.outputs.token }} diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index e032c1e..1cabe0b 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -4,12 +4,12 @@ on: push: branches: - main - pull_request_target: + pull_request: jobs: golangci: name: GolangCI - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - name: GolangCI diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e713eb7..881cb9c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,7 @@ on: jobs: release: name: Release - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v3 @@ -15,7 +15,7 @@ jobs: - name: Setup go uses: actions/setup-go@v3 with: - go-version: '1.17.x' + go-version: "1.17.x" - name: Cache Go Dependencies uses: actions/cache@v3