Skip to content

Commit

Permalink
Update Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jikoo committed Mar 3, 2024
1 parent f912567 commit b4f8eef
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 56 deletions.
34 changes: 10 additions & 24 deletions .github/workflows/auto-merge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: automerge
if: github.actor == 'dependabot[bot]' && steps.wait-for-build.outputs.conclusion == 'success'
uses: "pascalgn/[email protected]"
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 }}
36 changes: 4 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,9 @@ name: Build

on:
push:
branches:
- master
pull_request_target:
types: [ opened, synchronize, reopened ]
branches-ignore:
- dependabot/**

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
name: Build Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -P sonarcloud
run-ci:
uses: Jikoo/PlanarActions/.github/workflows/ci_maven.yml@master
13 changes: 13 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit b4f8eef

Please sign in to comment.