You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+34-4
Original file line number
Diff line number
Diff line change
@@ -42,10 +42,17 @@ Create a file at `.gitlab-ci.yml` with the following content.
42
42
43
43
```yml
44
44
stages:
45
+
- comment
45
46
- release
46
47
47
48
before_script: yarn --frozen-lockfile
48
49
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
+
49
56
release:
50
57
image: node:lts-alpine
51
58
only: main
@@ -54,14 +61,21 @@ release:
54
61
55
62
#### With Publishing
56
63
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.
58
65
59
66
```yml
60
67
stages:
68
+
- comment
61
69
- release
62
70
63
71
before_script: yarn --frozen-lockfile
64
72
73
+
comment:
74
+
image: node:lts-alpine
75
+
stage: comment
76
+
only: merge_requests
77
+
script: yarn changesets-gitlab -c
78
+
65
79
release:
66
80
image: node:lts-alpine
67
81
only: main
@@ -70,14 +84,14 @@ release:
70
84
INPUT_PUBLISH: yarn release
71
85
```
72
86
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:
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:
81
95
82
96
```yml
83
97
script: |
@@ -95,10 +109,18 @@ If the version script is present, this action will run that script instead of `c
95
109
96
110
```yml
97
111
stages:
112
+
- comment
98
113
- release
99
114
100
115
before_script: yarn --frozen-lockfile
101
116
117
+
comment:
118
+
image: node:lts-alpine
119
+
stage: comment
120
+
only:
121
+
- merge_requests
122
+
script: yarn changesets-gitlab -c
123
+
102
124
release:
103
125
image: node:lts-alpine
104
126
only: main
@@ -113,10 +135,18 @@ If you are using [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp), you shoul
0 commit comments