From 066921d3d0164ab013aaedb0f90d3a7ef68bac23 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 16 May 2024 11:37:54 -0700 Subject: [PATCH] Check changesets separately so it doesn't block preview deploy --- .github/workflows/CI.yml | 29 ------------------ .github/workflows/check-changesets.yml | 41 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/check-changesets.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8ce3fe9fbc62..ab276227d9c8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -75,32 +75,3 @@ jobs: with: name: missing.patch path: missing.patch - - changesets: - name: changesets - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - with: - fetch-depth: 0 - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version: 'lts/*' - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - - run: pnpm install - - - name: Check for missing changesets - run: | - PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l) - MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l) - - # If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit - if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then - echo "This PR is a versioning PR, exiting" - exit 0 - fi - - # git switch -c changesets-temp - # git checkout origin/v2 -- - pnpm changeset status --since=origin/v2 diff --git a/.github/workflows/check-changesets.yml b/.github/workflows/check-changesets.yml new file mode 100644 index 000000000000..772a67e1b342 --- /dev/null +++ b/.github/workflows/check-changesets.yml @@ -0,0 +1,41 @@ +name: Check changesets +on: + pull_request: + branches: + - v2 + +# Ensure scripts are run with pipefail. See: +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference +defaults: + run: + shell: bash + +jobs: + changesets: + name: changesets + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + with: + fetch-depth: 0 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 'lts/*' + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 + + - run: pnpm install + + - name: Check for missing changesets + run: | + PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l) + MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l) + + # If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit + if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then + echo "This PR is a versioning PR, exiting" + exit 0 + fi + + # git switch -c changesets-temp + # git checkout origin/v2 -- + pnpm changeset status --since=origin/v2