Przeglądaj źródła

Update GitHub workflows to support [ci skip] tag

(It also now only respects "relevant" files like gradle configs and source files by default)
Max 4 lat temu
rodzic
commit
a3e8bbd8f4
2 zmienionych plików z 14 dodań i 1 usunięć
  1. 6 0
      .github/workflows/publish.yml
  2. 8 1
      .github/workflows/snapshot.yml

+ 6 - 0
.github/workflows/publish.yml

@@ -2,6 +2,10 @@ name: Java CI
 
 on:
   push:
+    paths:
+      - '**.gradle'
+      - '**.properties'
+      - '**/src/**'
     branches:
       - "1.16"
       - "1.17"
@@ -17,6 +21,8 @@ jobs:
           java-version: 1.8
       - name: Upload to Bintray
         run: ./gradlew bintrayUpload curseforgePublish --stacktrace
+        if: |
+          !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]')
         env:
           BINTRAY_USER: shedaniel
           BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}

+ 8 - 1
.github/workflows/snapshot.yml

@@ -1,7 +1,12 @@
 name: Snapshot Compile & Release
 
 on:
-  [pull_request]
+  pull_request:
+    paths:
+      - '**.gradle'
+      - '**.properties'
+      - '**/src/**'
+    types: [ opened, synchronize, reopened ]
 
 jobs:
   build:
@@ -16,6 +21,8 @@ jobs:
           java-version: 1.8
       - name: Upload to Bintray
         run: ./gradlew bintrayUpload --stacktrace
+        if: |
+          !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]')
         env:
           BINTRAY_USER: shedaniel
           BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}