Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2b10f3d

Browse files
committedAug 16, 2021
docs: document about comment automatically
1 parent 5e2d736 commit 2b10f3d

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed
 

‎README.md

+34-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,17 @@ Create a file at `.gitlab-ci.yml` with the following content.
4242

4343
```yml
4444
stages:
45+
- comment
4546
- release
4647

4748
before_script: yarn --frozen-lockfile
4849

50+
comment:
51+
image: node:lts-alpine
52+
stage: comment
53+
only: merge_requests
54+
script: yarn changesets-gitlab -c # comment automatically like https://github.com/changesets/bot
55+
4956
release:
5057
image: node:lts-alpine
5158
only: main
@@ -54,14 +61,21 @@ release:
5461
5562
#### With Publishing
5663
57-
Before you can setup this action with publishing, you'll need to have an [npm token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) that can publish the packages in the repo you're setting up the action for and doesn't have 2FA on publish enabled ([2FA on auth can be enabled](https://docs.npmjs.com/about-two-factor-authentication)). You'll also need to [add it as a secret on your GitHub repo](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) with the name `NPM_TOKEN`. Once you've done that, you can create a file at `.github/workflows/release.yml` with the following content.
64+
Before you can setup this action with publishing, you'll need to have an [npm token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) that can publish the packages in the repo you're setting up the action for and doesn't have 2FA on publish enabled ([2FA on auth can be enabled](https://docs.npmjs.com/about-two-factor-authentication)). You'll also need to [add it as a custom environment variable on your GitLab repo](https://docs.gitlab.com/ee/ci/variables/#custom-cicd-variables) with the name `NPM_TOKEN`. Once you've done that, you can create a file at `.gitlab-ci.yml` with the following content.
5865

5966
```yml
6067
stages:
68+
- comment
6169
- release
6270
6371
before_script: yarn --frozen-lockfile
6472
73+
comment:
74+
image: node:lts-alpine
75+
stage: comment
76+
only: merge_requests
77+
script: yarn changesets-gitlab -c
78+
6579
release:
6680
image: node:lts-alpine
6781
only: main
@@ -70,14 +84,14 @@ release:
7084
INPUT_PUBLISH: yarn release
7185
```
7286

73-
By default the GitHub Action creates a `.npmrc` file with the following content:
87+
By default the GitLab CI cli creates a `.npmrc` file with the following content:
7488

7589
```sh
7690
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}
7791
```
7892

79-
However, if a `.npmrc` file is found, the GitHub Action does not recreate the file. This is useful if you need to configure the `.npmrc` file on your own.
80-
For example, you can add a step before running the Changesets GitHub Action:
93+
However, if a `.npmrc` file is found, the GitLab CI cli does not recreate the file. This is useful if you need to configure the `.npmrc` file on your own.
94+
For example, you can add a step before running the Changesets GitLab CI cli:
8195

8296
```yml
8397
script: |
@@ -95,10 +109,18 @@ If the version script is present, this action will run that script instead of `c
95109

96110
```yml
97111
stages:
112+
- comment
98113
- release
99114
100115
before_script: yarn --frozen-lockfile
101116
117+
comment:
118+
image: node:lts-alpine
119+
stage: comment
120+
only:
121+
- merge_requests
122+
script: yarn changesets-gitlab -c
123+
102124
release:
103125
image: node:lts-alpine
104126
only: main
@@ -113,10 +135,18 @@ If you are using [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp), you shoul
113135

114136
```yml
115137
stages:
138+
- comment
116139
- release
117140
118141
before_script: yarn --frozen-lockfile
119142
143+
comment:
144+
image: node:lts-alpine
145+
stage: comment
146+
only:
147+
- merge_requests
148+
script: yarn changesets-gitlab -c
149+
120150
release:
121151
image: node:lts-alpine
122152
only: main

‎package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"require": "./lib/index.cjs"
1717
},
1818
"files": [
19-
"lib",
20-
"!lib/*.tsbuildinfo"
19+
"lib"
2120
],
2221
"scripts": {
2322
"build": "run-p build:*",

0 commit comments

Comments
 (0)
Please sign in to comment.