From a2238472f36560192b1302722ba9af20e1786a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Tue, 15 Oct 2024 19:58:31 +0000 Subject: [PATCH 1/2] chore: disable running on dependabot --- .github/workflows/main.yml | 47 +++++++++++++++++++------------------- .github/workflows/pr.yml | 5 ++-- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f2817e..6380ea7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,11 +6,11 @@ on: workflow_call: push: branches: - - main - - release/* + - main + - release/* pull_request: branches: - - main + - main jobs: test: @@ -18,23 +18,23 @@ jobs: permissions: checks: write steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: ./go.mod - - run: make test - - uses: dorny/test-reporter@v1 - if: success() || failure() - with: - name: Go Test Results - path: .test/reports/**-test.xml - reporter: java-junit - fail-on-error: 'true' - - uses: actions/upload-artifact@v3 - if: success() || failure() - with: - name: Test Reports - path: .test/reports/** + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + - run: make test + - uses: dorny/test-reporter@v1 + if: success() || failure() + with: + name: Go Test Results + path: .test/reports/**-test.xml + reporter: java-junit + fail-on-error: "true" + - uses: actions/upload-artifact@v3 + if: success() || failure() + with: + name: Test Reports + path: .test/reports/** lint: runs-on: ubuntu-latest @@ -47,16 +47,17 @@ jobs: - run: make lint deploy: + if: ${{ github.actor != 'dependabot[bot]' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 20 - + - run: npx cdktf-cli get - uses: hashicorp/terraform-cdk-action@v5 @@ -65,4 +66,4 @@ jobs: terraformVersion: 1.9.5 mode: auto-approve-apply stackName: stack - githubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3c05076..df27144 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,11 +16,12 @@ jobs: uses: ./.github/workflows/main.yml plan: + if: ${{ github.actor != 'dependabot[bot]' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 20 @@ -31,4 +32,4 @@ jobs: terraformVersion: 1.9.5 mode: plan-only stackName: stack - githubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + githubToken: ${{ secrets.GITHUB_TOKEN }} From 25846df37cff79261aaee8dc08014cac8b68d694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Tue, 15 Oct 2024 20:00:09 +0000 Subject: [PATCH 2/2] chore: dependabot automerge --- .github/workflows/automerge.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..db1aa7c --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,23 @@ +# .github/workflows/automerge.yml + +name: Dependabot (auto-merge) + +on: + pull_request: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}