Skip to content

Commit 3e26c8e

Browse files
committed
fix: update pull-request based on the npm docs
1 parent c9acbf0 commit 3e26c8e

1 file changed

Lines changed: 49 additions & 1 deletion

File tree

.github/workflows/pull-request.yaml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,55 @@ jobs:
2020
permissions:
2121
contents: read
2222
id-token: write
23-
uses: ./.github/workflows/beta-release.yaml
23+
if: github.event.pull_request.draft == false
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
ref: ${{ github.head_ref }}
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: '20.x'
32+
registry-url: 'https://registry.npmjs.org'
33+
cache: 'yarn'
34+
35+
- name: Install dev dependencies
36+
run: yarn install
37+
38+
- name: Setup git credentials
39+
run: |
40+
git config --global user.name 'Auto Release Bot'
41+
git config --global user.email 'auto-release-bot@users.noreply.github.com'
42+
43+
- name: Get current package.json version
44+
run: echo "PACKAGE_VERSION=$(npm pkg get version)" >> $GITHUB_ENV
45+
46+
- name: Setup Beta Release Version
47+
run: node beta-release.js --issue $GITHUB_PR_NUMBER
48+
env:
49+
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
50+
51+
- name: Release a new beta version
52+
run: npm publish --tag beta --provenance --access public
53+
54+
- uses: actions/github-script@v6
55+
with:
56+
script: |
57+
github.rest.issues.createComment({
58+
issue_number: context.issue.number,
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
body: `Beta version released with the last commit 🚀
62+
63+
\`\`\`
64+
yarn add react-tooltip@${{ env.NEW_VERSION }}
65+
\`\`\`
66+
or
67+
\`\`\`
68+
npm install react-tooltip@${{ env.NEW_VERSION }}
69+
\`\`\`
70+
`
71+
})
2472
2573
fail_if_pull_request_is_draft:
2674
if: github.event.pull_request.draft == true

0 commit comments

Comments
 (0)