changesets-auto-pr #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will run changesets version and create PR to master | |
name: changesets-auto-pr | |
on: | |
workflow_dispatch: | |
push: | |
branches-ignore: | |
- master | |
paths: | |
- '.changeset/*' | |
jobs: | |
replace-package-json-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: install dependencies | |
run: | | |
npm i pnpm -g | |
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 | |
id: changesetStatus | |
run: | | |
node ./changeset-status.cjs | |
- name: changesets-version | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
title: Pull Request ${{ steps.changesetStatus.outputs.status }} | |
version: node ./node_modules/@changesets/cli/bin.js version --snapshot prepublish | |
publish: npm run pub:only | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Dingtalk Notify | |
uses: zcong1993/actions-ding@master | |
if: steps.changesets.outputs.hasChangesets == 'true' | |
with: | |
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }} | |
body: | | |
{ | |
"msgtype": "markdown", | |
"markdown": { | |
"title":"orca-fe PR 创建提示", | |
"text": "## Orca-Pocket PR 已创建\n 请查看[PR列表](https://github.com/orca-team/pocket/pulls)" | |
}, | |
"at": { | |
"isAtAll": false | |
} | |
} |