-
Notifications
You must be signed in to change notification settings - Fork 3.2k
89 lines (75 loc) · 2.62 KB
/
comment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# https://github.com/marketplace/actions/automatic-rebase (https://github.com/cirrus-actions/rebase)
name: Comment
on:
issue_comment:
types:
- created
permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: read # to get info about PR (cirrus-actions/rebase)
jobs:
rebase:
permissions:
contents: write # to push code to rebase (cirrus-actions/rebase)
pull-requests: read # to get info about PR (cirrus-actions/rebase)
name: rebase
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/rebase')
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Rebase PR
uses: cirrus-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release_next:
permissions:
contents: read # to fetch code (actions/checkout)
pull-requests: write # to create or update comment (peter-evans/create-or-update-comment)
name: release:next
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
github.event.sender.login == 'ianstormtaylor' &&
startsWith(github.event.comment.body, '/release:next')
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout pull request
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 18.x
cache: yarn
registry-url: https://registry.npmjs.org
key: node18
- name: Install dependencies
run: yarn
- name: Prepare release
run: yarn prerelease
# https://github.com/atlassian/changesets/blob/master/docs/snapshot-releases.md
- name: Release to @pr channel
run: |
yarn changeset version --snapshot
yarn changeset publish --tag pr
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get released version
id: version
run: echo ::set-output name=version::$(node -p "require('./packages/slate/package.json').version")
- name: Create comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: |
A new release has been made for this pull request. You can install it with `yarn add slate@${{ steps.version.outputs.version }}`.