From 3573bdad8a2c12048afbc1e69c626234dc01955d Mon Sep 17 00:00:00 2001 From: Jikoo Date: Sun, 3 Mar 2024 13:10:58 -0500 Subject: [PATCH] Update Actions --- .github/workflows/auto-merge-dependabot.yml | 34 ++++++--------------- .github/workflows/ci.yml | 12 +++----- .github/workflows/pull_request.yml | 13 ++++++++ appveyor.yml | 2 +- 4 files changed, 29 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index 0da119a..ba6410d 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/auto-merge-dependabot.yml @@ -1,29 +1,15 @@ name: Auto-merge Dependabot PRs on: - pull_request_target + workflow_run: + workflows: [ "Pull Request" ] + types: [ completed ] jobs: - auto-approve: - runs-on: ubuntu-latest - steps: - - name: Wait for build success - uses: fountainhead/action-wait-for-check@v1.0.0 - id: wait-for-build - if: github.actor == 'dependabot[bot]' - with: - token: ${{ secrets.GITHUB_TOKEN }} - checkName: 'Build Java 17' - ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: autoapprove - if: github.actor == 'dependabot[bot]' && steps.wait-for-build.outputs.conclusion == 'success' - uses: hmarr/auto-approve-action@v2.0.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: automerge - if: github.actor == 'dependabot[bot]' && steps.wait-for-build.outputs.conclusion == 'success' - uses: "pascalgn/automerge-action@v0.12.0" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - MERGE_LABELS: "dependencies" - MERGE_METHOD: "squash" + automerge-dependabot-pr: + if: "github.actor == 'dependabot[bot]' + && github.event.workflow_run.event == 'pull_request' + && github.event.workflow_run.conclusion == 'success'" + uses: Jikoo/PlanarActions/.github/workflows/pr_automerge_complete.yml@master + with: + triggering-workflow-run: ${{ github.event.workflow_run.id }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d24d3d..dbba0de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,27 +2,25 @@ name: Build on: push: - branches: - - master - pull_request_target: - types: [ opened, synchronize, reopened ] + branches-ignore: + - dependabot/** jobs: build: runs-on: ubuntu-latest name: Build Java 17 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: '17' cache: 'maven' - name: Cache SonarCloud packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..236f785 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,13 @@ +name: Pull Request + +on: + pull_request: + +jobs: + run-ci: + uses: Jikoo/PlanarActions/.github/workflows/ci_maven.yml@master + store-dependabot-pr-data: + if: "github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'" + uses: Jikoo/PlanarActions/.github/workflows/pr_automerge_prep.yml@master + with: + pr-number: ${{ github.event.number }} diff --git a/appveyor.yml b/appveyor.yml index 6d8c2d3..44afe8e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ only_commits: - pom.xml - appveyor.yml version: '{build}' -clone_depth: 10 +shallow_clone: true environment: matrix: - appveyor_build_worker_image: Visual Studio 2022