From 82ac84ee7cdaa203660c7ea032833b093fb372cf Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Sat, 16 Sep 2023 16:33:23 -0700 Subject: [PATCH] Update CI scripts --- .github/workflows/ci-chromatic.yaml | 15 +++------------ .github/workflows/ci-docs.yaml | 11 ++--------- .github/workflows/ci-server.yaml | 11 ++--------- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci-chromatic.yaml b/.github/workflows/ci-chromatic.yaml index 16cabdcaa..fcf0a7cd0 100644 --- a/.github/workflows/ci-chromatic.yaml +++ b/.github/workflows/ci-chromatic.yaml @@ -4,25 +4,16 @@ on: push: branches: - main - pull_request_target: + pull_request: types: [labeled] jobs: chromatic-deployment: - if: ${{ contains(github.event.*.labels.*.name, 'run-chromatic') }} || github.event_name == 'push' }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'run-chromatic') }} || github.event_name == 'push' }} runs-on: ubuntu-latest env: REACT_APP_SERVER_BASE_URL: http://127.0.0.1:3000 steps: - - uses: actions/checkout@v3 - if: github.event_name == 'push' - with: - fetch-depth: 0 - ref: ${{ github.head_ref || github.ref_name }} - - uses: actions/checkout@v3 - if: github.event_name == 'pull_request_target' - with: - fetch-depth: 0 - ref: "refs/pull/${{ github.event.number }}/merge" + - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci-docs.yaml b/.github/workflows/ci-docs.yaml index 13b31ea9c..f066479ed 100644 --- a/.github/workflows/ci-docs.yaml +++ b/.github/workflows/ci-docs.yaml @@ -3,19 +3,12 @@ on: push: branches: - main - pull_request_target: + pull_request: jobs: docs-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - if: github.event_name == 'push' - with: - ref: ${{ github.head_ref || github.ref_name }} - - uses: actions/checkout@v3 - if: github.event_name == 'pull_request_target' - with: - ref: "refs/pull/${{ github.event.number }}/merge" + - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 with: diff --git a/.github/workflows/ci-server.yaml b/.github/workflows/ci-server.yaml index 76266590c..2d1758ada 100644 --- a/.github/workflows/ci-server.yaml +++ b/.github/workflows/ci-server.yaml @@ -3,7 +3,7 @@ on: push: branches: - main - pull_request_target: + pull_request: jobs: server-test: runs-on: ubuntu-latest @@ -24,14 +24,7 @@ jobs: --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v3 - if: github.event_name == 'push' - with: - ref: ${{ github.head_ref || github.ref_name }} - - uses: actions/checkout@v3 - if: github.event_name == 'pull_request_target' - with: - ref: "refs/pull/${{ github.event.number }}/merge" + - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 with: