From 1135ad5a5a17537bc15acc13fc94c31aa4f797de Mon Sep 17 00:00:00 2001 From: Marcus Hert Da Coregio Date: Fri, 28 Jun 2024 09:31:48 -0300 Subject: [PATCH] Skip checkExpectedBranchVersion task on PR Build workflow Issue gh-15226 --- .github/workflows/pr-build-workflow.yml | 2 +- .../security/CheckExpectedBranchVersionPlugin.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-workflow.yml b/.github/workflows/pr-build-workflow.yml index daa66c9b17..c6f0f9ba78 100644 --- a/.github/workflows/pr-build-workflow.yml +++ b/.github/workflows/pr-build-workflow.yml @@ -21,7 +21,7 @@ jobs: java-version: '11' distribution: 'adopt' - name: Build with Gradle - run: ./gradlew clean build --continue + run: ./gradlew clean build -PskipCheckExpectedBranchVersion --continue generate-docs: name: Generate Docs runs-on: ubuntu-latest diff --git a/buildSrc/src/main/java/org/springframework/security/CheckExpectedBranchVersionPlugin.java b/buildSrc/src/main/java/org/springframework/security/CheckExpectedBranchVersionPlugin.java index 40b943856c..9266f7c4d5 100644 --- a/buildSrc/src/main/java/org/springframework/security/CheckExpectedBranchVersionPlugin.java +++ b/buildSrc/src/main/java/org/springframework/security/CheckExpectedBranchVersionPlugin.java @@ -45,6 +45,9 @@ public class CheckExpectedBranchVersionPlugin implements Plugin { @TaskAction public void run() throws IOException { Project project = getProject(); + if (project.hasProperty("skipCheckExpectedBranchVersion")) { + return; + } String version = (String) project.getVersion(); String branchVersion = getBranchVersion(project); if (!branchVersion.matches("^[0-9]+\\.[0-9]+\\.x$")) {