From 48389d965624d554f82bca4abaa5975567582835 Mon Sep 17 00:00:00 2001 From: Roberto Mosca Date: Thu, 28 Sep 2023 22:58:17 +0200 Subject: [PATCH] Add check for changeset in CI (#191) * Add check for changeset in CI * Fix changeset status check * Fix checkout depth * Fix format * Add changeset * Run changeset directly from CI with pnpm exec * Use @changesets/changelog-github for formatting changelog --- .changeset/config.json | 7 +++++-- .changeset/heavy-starfishes-study.md | 5 +++++ .github/workflows/build-test-release.yml | 4 ++++ package.json | 1 + pnpm-lock.yaml | 26 ++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .changeset/heavy-starfishes-study.md diff --git a/.changeset/config.json b/.changeset/config.json index f26daf1..1a1810c 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,11 +1,14 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json", - "changelog": "@changesets/cli/changelog", + "changelog": [ + "@changesets/changelog-github", + { "repo": "single-spa/single-spa-react" } + ], "commit": false, "fixed": [], "linked": [], "access": "public", - "baseBranch": "main", + "baseBranch": "origin/main", "updateInternalDependencies": "patch", "ignore": [] } diff --git a/.changeset/heavy-starfishes-study.md b/.changeset/heavy-starfishes-study.md new file mode 100644 index 0000000..9bf3496 --- /dev/null +++ b/.changeset/heavy-starfishes-study.md @@ -0,0 +1,5 @@ +--- +"single-spa-react": patch +--- + +Add check for changeset being present in PRs diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 9732868..823cf38 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -14,6 +14,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + # check out full history + fetch-depth: 0 - name: Install Pnpm uses: pnpm/action-setup@v2 @@ -36,6 +39,7 @@ jobs: run: | pnpm run lint pnpm run check-format + pnpm exec changeset status --since=origin/main - name: Build run: pnpm run build diff --git a/package.json b/package.json index dc18257..38ff280 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@babel/preset-env": "^7.15.6", "@babel/preset-react": "^7.14.5", "@babel/runtime": "^7.15.4", + "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.2", "@jest/types": "^27.1.1", "@rollup/plugin-babel": "^5.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a78770..3f5d5a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,9 @@ devDependencies: '@babel/runtime': specifier: ^7.15.4 version: 7.15.4 + '@changesets/changelog-github': + specifier: ^0.4.8 + version: 0.4.8 '@changesets/cli': specifier: ^2.26.2 version: 2.26.2 @@ -1528,6 +1531,16 @@ packages: '@changesets/types': 5.2.1 dev: true + /@changesets/changelog-github@0.4.8: + resolution: {integrity: sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==} + dependencies: + '@changesets/get-github-info': 0.5.2 + '@changesets/types': 5.2.1 + dotenv: 8.6.0 + transitivePeerDependencies: + - encoding + dev: true + /@changesets/cli@2.26.2: resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} hasBin: true @@ -1595,6 +1608,15 @@ packages: semver: 7.5.4 dev: true + /@changesets/get-github-info@0.5.2: + resolution: {integrity: sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==} + dependencies: + dataloader: 1.4.0 + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: true + /@changesets/get-release-plan@3.0.17: resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} dependencies: @@ -3271,6 +3293,10 @@ packages: whatwg-url: 8.7.0 dev: true + /dataloader@1.4.0: + resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} + dev: true + /date-fns@2.24.0: resolution: {integrity: sha512-6ujwvwgPID6zbI0o7UbURi2vlLDR9uP26+tW6Lg+Ji3w7dd0i3DOcjcClLjLPranT60SSEFBwdSyYwn/ZkPIuw==} engines: {node: '>=0.11'}