From cde045d6fdccf1039255b6ce750f0692804097a2 Mon Sep 17 00:00:00 2001 From: games647 Date: Tue, 29 Jun 2021 12:55:37 +0200 Subject: [PATCH] Only build for main branches to fix duplicate actions with dependabot --- .github/workflows/maven.yml | 62 ++++++++++--------- .../listener/protocollib/NameCheckTask.java | 3 +- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4c8cfb3c..7ae5ed1b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -4,11 +4,15 @@ # Human readable name in the actions tab name: Java CI -# Build on every push and pull request regardless of the branch +# Build on every pull request regardless of the branch # Wiki: https://help.github.com/en/actions/reference/events-that-trigger-workflows on: - - push - - pull_request + push: + branches: + - main + pull_request: + branches: + - main jobs: # job id @@ -19,32 +23,32 @@ jobs: # Run steps steps: - # Pull changes - - uses: actions/checkout@v2.3.4 + # Pull changes + - uses: actions/checkout@v2.3.4 - # Cache artifacts - however this has the downside that we don't get notified of - # artifact resolution failures like invalid repository - # Nevertheless the repositories should be more stable and it makes no sense to pull - # a same version every time - # A dry run would make more sense - - uses: actions/cache@v2.1.4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + # Cache artifacts - however this has the downside that we don't get notified of + # artifact resolution failures like invalid repository + # Nevertheless the repositories should be more stable and it makes no sense to pull + # a same version every time + # A dry run would make more sense + - uses: actions/cache@v2.1.4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - # Setup Java - - name: Set up JDK - uses: actions/setup-java@v2.1.0 - with: - distribution: 'adopt' - # Use Java 11, because it's minimum required version - java-version: 11 + # Setup Java + - name: Set up JDK + uses: actions/setup-java@v2.1.0 + with: + distribution: 'adopt' + # Use Java 11, because it's minimum required version + java-version: 11 - # Build and test (included in package) - - name: Build with Maven and test - # Run non-interactive, package (with compile+test), - # ignore snapshot updates, because they are likely to have breaking changes, enforce checksums to validate - # possible errors in dependencies - run: mvn test --batch-mode --no-snapshot-updates --strict-checksums --file pom.xml + # Build and test (included in package) + - name: Build with Maven and test + # Run non-interactive, package (with compile+test), + # ignore snapshot updates, because they are likely to have breaking changes, enforce checksums to validate + # possible errors in dependencies + run: mvn test --batch-mode --no-snapshot-updates --strict-checksums --file pom.xml diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java index 23c5f6ac..54d2ea3e 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java @@ -74,7 +74,8 @@ public class NameCheckTask extends JoinManagement