Browse Source

chore: skip actions gracefully

Gerald 5 years ago
parent
commit
170ba70dc9
2 changed files with 6 additions and 3 deletions
  1. 0 1
      .github/workflows/release.yml
  2. 6 2
      .github/workflows/transifex-push-resources.yml

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

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

+ 6 - 2
.github/workflows/transifex-push-resources.yml

@@ -8,7 +8,6 @@ on:
 jobs:
   build:
     runs-on: ubuntu-latest
-    continue-on-error: true
     steps:
       - name: Checkout code
         uses: actions/checkout@v2
@@ -19,14 +18,19 @@ jobs:
         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
+          if ! curl -fsSL $diff_url | grep -q '^diff --git a/src/'; then
+            echo SKIP_REST=1 >> $GITHUB_ENV
+            exit 0
+          fi
           yarn
         env:
           COMMIT_BEFORE: ${{ github.event.before }}
           COMMIT_AFTER: ${{ github.event.after }}
       - name: Update locale files
+        if: ${{ !env.SKIP_REST }}
         run: yarn copyI18n
       - name: Upload to Transifex
+        if: ${{ !env.SKIP_REST }}
         run: 'curl -i -L --user api:$TRANSIFEX_TOKEN -X PUT -F file=@dist/_locales/en/messages.json https://www.transifex.com/api/2/project/violentmonkey-nex/resource/messagesjson/content/'
         env:
           TRANSIFEX_TOKEN: ${{ secrets.TRANSIFEX_TOKEN }}