Skip to content

Commit

Permalink
test: changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoKam committed Mar 31, 2024
1 parent 0bf6c84 commit 7363ef1
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 3 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/changesets-auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,25 @@ jobs:
pnpm i --no-frozen-lockfile
- name: Get current timestamp
run: echo "timestamp=$(date +'%Y-%m-%d_%H_%M_%S')" >> $GITHUB_ENV
- name: Get changeset status
uses: actions/github-script@v5
id: changesetStatus
with:
script: |
require('zx/globals');
const fs = require('fs');
const core = require('@actions/core');
await $`npx changeset status --output changeset-status.json`;
const status = JSON.parse(fs.readFileSync('changeset-status.json'));
const message = [...new Set(status.changesets.map(({summary}) => summary))].join('; ');
core.setOutput('status', message);
- name: changesets-version
id: changesets
uses: changesets/action@v1
with:
title: Pull Request ${{ env.timestamp }}
title: Pull Request ${{ steps.changesetStatus.outputs.status }}
version: changeset version --snapshot prepublish
publish: npm run pub:only
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Dingtalk Notify
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"react-dom": "^18.2.0",
"ts-jest": "^29.1.1",
"tslib": "^2.6.2",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"zx": "^7.2.3"
},
"peerDependencies": {
"react": ">=16"
Expand Down
96 changes: 95 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7363ef1

Please sign in to comment.