👷 Add Automerge to CI/CD

This commit is contained in:
louis 2022-10-22 14:35:56 +02:00
parent 26ade08c6b
commit 12685d0ff6
3 changed files with 30 additions and 9 deletions

View file

@ -4,19 +4,19 @@ on:
push: push:
branches: branches:
- main - main
pull_request_target: pull_request:
jobs: jobs:
test: test:
name: Test name: Test
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup go - name: Setup go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: '1.17.x' go-version: "1.17.x"
- name: Cache Go Dependencies - name: Cache Go Dependencies
uses: actions/cache@v3 uses: actions/cache@v3
@ -36,7 +36,7 @@ jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-20.04
needs: needs:
- test - test
steps: steps:
@ -45,7 +45,7 @@ jobs:
- name: Setup go - name: Setup go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: '1.17.x' go-version: "1.17.x"
- name: Cache Go Dependencies - name: Cache Go Dependencies
uses: actions/cache@v3 uses: actions/cache@v3
@ -62,3 +62,24 @@ jobs:
- name: Docker - name: Docker
run: docker build . 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 }}

View file

@ -4,12 +4,12 @@ on:
push: push:
branches: branches:
- main - main
pull_request_target: pull_request:
jobs: jobs:
golangci: golangci:
name: GolangCI name: GolangCI
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: GolangCI - name: GolangCI

View file

@ -7,7 +7,7 @@ on:
jobs: jobs:
release: release:
name: Release name: Release
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -15,7 +15,7 @@ jobs:
- name: Setup go - name: Setup go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: '1.17.x' go-version: "1.17.x"
- name: Cache Go Dependencies - name: Cache Go Dependencies
uses: actions/cache@v3 uses: actions/cache@v3