Ver código fonte

meta: fix race condition in `e2e.yml`

Antoine du Hamel 1 ano atrás
pai
commit
f6b18c240a
1 arquivos alterados com 4 adições e 8 exclusões
  1. 4 8
      .github/workflows/e2e.yml

+ 4 - 8
.github/workflows/e2e.yml

@@ -191,10 +191,8 @@ jobs:
       - name: Add label
         if:
           (needs.compare_diff.outputs.diff != '' ||
-          !needs.compare_diff.outputs.is_accurate_diff) &&
-          (!contains(github.event.pull_request.labels.*.name, 'safe to test') &&
-          !contains(github.event.pull_request.labels.*.name, 'pending end-to-end
-          tests'))
+          !needs.compare_diff.outputs.is_accurate_diff) && (github.event.action
+          != 'labeled' || github.event.label.name != 'safe to test')
         env:
           PR_URL: ${{ github.event.pull_request.html_url }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -204,10 +202,8 @@ jobs:
       - name: Remove label
         if:
           needs.compare_diff.outputs.diff == '' &&
-          needs.compare_diff.outputs.is_accurate_diff &&
-          (contains(github.event.pull_request.labels.*.name, 'safe to test') ||
-          contains(github.event.pull_request.labels.*.name, 'pending end-to-end
-          tests'))
+          needs.compare_diff.outputs.is_accurate_diff && github.event.action ==
+          'labeled' && github.event.label.name == 'safe to test'
         env:
           PR_URL: ${{ github.event.pull_request.html_url }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}