Browse Source

chore: skip pushing resources when src is untouched

Gerald 5 years ago
parent
commit
3eb51e73e8
2 changed files with 11 additions and 4 deletions
  1. 1 0
      .github/workflows/release.yml
  2. 10 4
      .github/workflows/transifex-push-resources.yml

+ 1 - 0
.github/workflows/release.yml

@@ -8,6 +8,7 @@ on:
 jobs:
   build:
     runs-on: ubuntu-latest
+    continue-on-error: true
     steps:
       - uses: actions/checkout@v2
         with:

+ 10 - 4
.github/workflows/transifex-push-resources.yml

@@ -7,17 +7,23 @@ on:
 
 jobs:
   build:
-
     runs-on: ubuntu-latest
-
+    continue-on-error: true
     steps:
       - name: Checkout code
         uses: actions/checkout@v2
       - uses: actions/setup-node@v2-beta
         with:
           node-version: '15'
-      - name: Install deps
-        run: yarn
+      - name: Prepare
+        run: |
+          # Continue only if files in src/ is changed
+          diff_url=https://github.com/violentmonkey/violentmonkey/compare/$COMMIT_BEFORE..$COMMIT_AFTER.diff
+          curl -fsSL $diff_url | grep '^diff --git a/src/' || exit 1
+          yarn
+        env:
+          COMMIT_BEFORE: ${{ github.event.before }}
+          COMMIT_AFTER: ${{ github.event.after }}
       - name: Update locale files
         run: yarn copyI18n
       - name: Upload to Transifex