Skip to content

Commit 8b29099

Browse files
committed
Avoid dependabot building twice the project
Dependabot is both creating a PR and pushing code to the repository. Let's only allow running when it's pushing the code.
1 parent e5403c5 commit 8b29099

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/workflows/pr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build the project
2+
on: [pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
if: ${{ github.actor != 'dependabot[bot]' }}
7+
permissions:
8+
contents: write
9+
packages: write
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v5
13+
with:
14+
ref: ${{ github.head_ref }}
15+
token: ${{ secrets.PAT }}
16+
- name: Update resources with Maven
17+
run: mvn -B process-resources
18+
- name: Update files if needed
19+
uses: stefanzweifel/git-auto-commit-action@v7
20+
- name: Set up JDK 17 and Maven Central Repository
21+
uses: actions/setup-java@v5
22+
with:
23+
java-version: '17'
24+
distribution: 'adopt'
25+
cache: 'maven'
26+
- name: Build the project and run integration tests
27+
run: mvn -B verify

.github/workflows/main.yml renamed to .github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build the project
2-
on: [push, pull_request]
2+
on: [push]
33
jobs:
44
build:
55
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)