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 }} 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 }}