Просмотр исходного кода

ci: cancel duplicate workflow runs and add read permissions

- Add concurrency settings to cancel outdated runs when new commits are pushed
- Add contents: read permission for security hardening
- Remove redundant required job that checked test results
Dax Raad 1 месяц назад
Родитель
Сommit
556703f8ab
1 измененных файлов с 8 добавлено и 15 удалено
  1. 8 15
      .github/workflows/test.yml

+ 8 - 15
.github/workflows/test.yml

@@ -6,6 +6,14 @@ on:
       - dev
       - dev
   pull_request:
   pull_request:
   workflow_dispatch:
   workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
 jobs:
 jobs:
   unit:
   unit:
     name: unit (${{ matrix.settings.name }})
     name: unit (${{ matrix.settings.name }})
@@ -86,18 +94,3 @@ jobs:
           path: |
           path: |
             packages/app/e2e/test-results
             packages/app/e2e/test-results
             packages/app/e2e/playwright-report
             packages/app/e2e/playwright-report
-
-  required:
-    name: test (linux)
-    runs-on: blacksmith-4vcpu-ubuntu-2404
-    needs:
-      - unit
-      - e2e
-    if: always()
-    steps:
-      - name: Verify upstream test jobs passed
-        run: |
-          echo "unit=${{ needs.unit.result }}"
-          echo "e2e=${{ needs.e2e.result }}"
-          test "${{ needs.unit.result }}" = "success"
-          test "${{ needs.e2e.result }}" = "success"