Explorar el Código

Skip release tests too when ci-skip provided in commit message

Julian Raufelder hace 2 años
padre
commit
b10d892b12
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      .github/workflows/build.yml

+ 5 - 2
.github/workflows/build.yml

@@ -16,7 +16,8 @@ jobs:
   release-check-precondition:
     name: Validate pushed commit to release/hotfix branch or pushed tag
     runs-on: ubuntu-latest
-    if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/hotfix/') || startsWith(github.ref, 'refs/heads/release/')
+    if: "(startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/hotfix/') || startsWith(github.ref, 'refs/heads/release/')) && \
+        !(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
     steps:
       - uses: actions/checkout@v2
       - id: validate-pom-version
@@ -47,7 +48,9 @@ jobs:
     name: Compile and Test
     needs: release-check-precondition
     runs-on: ubuntu-latest
-    if: "always() && (needs.release-check-precondition.result=='success' || needs.release-check-precondition.result=='skipped') && !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
+    if: "always() && \
+        (needs.release-check-precondition.result=='success' || needs.release-check-precondition.result=='skipped') && \
+        !(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
     steps:
       - uses: actions/checkout@v2
       - uses: actions/setup-java@v2