Skip to content

Commit 0daee06

Browse files
Merge pull request #54 from technote-space/release/next-v1.4.1
feat: release v1.5.0
2 parents 545a5c9 + 07ef298 commit 0daee06

File tree

12 files changed

+170
-128
lines changed

12 files changed

+170
-128
lines changed

README.ja.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
99

10-
`Release GitHub Actions` の CLIツール
11-
[Release GitHub Actions](https://github.com/technote-space/release-github-actions) をラップしたものです。
10+
[Release GitHub Actions](https://github.com/technote-space/release-github-actions) の CLIツール
1211

1312
## Table of Contents
1413

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
99

10-
CLI tool of `Release GitHub Actions`.
11-
Wrapper of [Release GitHub Actions](https://github.com/technote-space/release-github-actions).
10+
CLI tool of [Release GitHub Actions](https://github.com/technote-space/release-github-actions).
1211

1312
## Table of Contents
1413

__tests__/config.test.ts

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/* eslint-disable no-magic-numbers */
22
import { resolve } from 'path';
3+
import { getParams } from '@technote-space/release-github-actions/lib/utils/misc';
34
import { normalizeConfigKey, normalizeConfigKeys, getActionDefaultInputs, getConfig } from '../src/config';
45

56
const fixturesDir = resolve(__dirname, 'fixtures');
7+
beforeEach(() => {
8+
getParams.clear();
9+
});
610

711
describe('normalizeConfigKey', () => {
812
it('should normalize config key', () => {
@@ -32,18 +36,19 @@ describe('normalizeConfigKeys', () => {
3236
describe('getActionDefaultInputs', () => {
3337
it('should get inputs', () => {
3438
expect(getActionDefaultInputs()).toEqual({
35-
'BRANCH_NAME': 'gh-actions',
39+
'BRANCH_NAME': 'releases/${MAJOR}',
3640
'BUILD_COMMAND': '',
37-
'BUILD_COMMAND_TARGET': '',
41+
'BUILD_COMMAND_TARGET': 'build,production,prod,package',
3842
'CLEAN_TARGETS': '.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,*.yml,*.yaml',
3943
'CLEAN_TEST_TAG': 'false',
4044
'COMMIT_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com',
41-
'COMMIT_MESSAGE': 'feat: Build for release',
45+
'COMMIT_MESSAGE': 'feat: build for release',
4246
'COMMIT_NAME': 'github-actions[bot]',
4347
'CREATE_MAJOR_VERSION_TAG': 'true',
4448
'CREATE_MINOR_VERSION_TAG': 'true',
4549
'CREATE_PATCH_VERSION_TAG': 'true',
4650
'FETCH_DEPTH': '3',
51+
'GITHUB_TOKEN': '${{ github.token }}',
4752
'ORIGINAL_TAG_PREFIX': '',
4853
'OUTPUT_BUILD_INFO_FILENAME': '',
4954
'PACKAGE_MANAGER': '',
@@ -56,18 +61,19 @@ describe('getConfig', () => {
5661
it('should get config 1', () => {
5762
expect(getConfig(resolve(fixturesDir, 'test7'), undefined)).toEqual({
5863
'inputs': {
59-
'BRANCH_NAME': 'gh-actions',
64+
'BRANCH_NAME': 'releases/${MAJOR}',
6065
'BUILD_COMMAND': '',
61-
'BUILD_COMMAND_TARGET': '',
66+
'BUILD_COMMAND_TARGET': 'build,production,prod,package',
6267
'CLEAN_TARGETS': '.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,*.yml,*.yaml',
6368
'CLEAN_TEST_TAG': 'false',
6469
'COMMIT_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com',
65-
'COMMIT_MESSAGE': 'feat: Build for release',
70+
'COMMIT_MESSAGE': 'feat: build for release',
6671
'COMMIT_NAME': 'github-actions[bot]',
6772
'CREATE_MAJOR_VERSION_TAG': 'true',
6873
'CREATE_MINOR_VERSION_TAG': 'true',
6974
'CREATE_PATCH_VERSION_TAG': 'true',
7075
'FETCH_DEPTH': '5',
76+
'GITHUB_TOKEN': '${{ github.token }}',
7177
'ORIGINAL_TAG_PREFIX': '',
7278
'OUTPUT_BUILD_INFO_FILENAME': '',
7379
'PACKAGE_MANAGER': '',
@@ -82,18 +88,19 @@ describe('getConfig', () => {
8288
it('should get config 2', () => {
8389
expect(getConfig(resolve(fixturesDir, 'test8'), false)).toEqual({
8490
'inputs': {
85-
'BRANCH_NAME': 'gh-actions',
91+
'BRANCH_NAME': 'releases/${MAJOR}',
8692
'BUILD_COMMAND': '',
87-
'BUILD_COMMAND_TARGET': '',
93+
'BUILD_COMMAND_TARGET': 'build,production,prod,package',
8894
'CLEAN_TARGETS': '.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,*.yml,*.yaml',
8995
'CLEAN_TEST_TAG': 'false',
9096
'COMMIT_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com',
91-
'COMMIT_MESSAGE': 'feat: Build for release',
97+
'COMMIT_MESSAGE': 'feat: build for release',
9298
'COMMIT_NAME': 'github-actions[bot]',
9399
'CREATE_MAJOR_VERSION_TAG': 'true',
94100
'CREATE_MINOR_VERSION_TAG': 'true',
95101
'CREATE_PATCH_VERSION_TAG': 'true',
96102
'FETCH_DEPTH': '3',
103+
'GITHUB_TOKEN': '${{ github.token }}',
97104
'ORIGINAL_TAG_PREFIX': '',
98105
'OUTPUT_BUILD_INFO_FILENAME': '',
99106
'PACKAGE_MANAGER': '',
@@ -107,18 +114,19 @@ describe('getConfig', () => {
107114
it('should get config 3', () => {
108115
expect(getConfig(resolve(fixturesDir, 'test9'), true)).toEqual({
109116
'inputs': {
110-
'BRANCH_NAME': 'gh-actions',
117+
'BRANCH_NAME': 'releases/${MAJOR}, gh-actions',
111118
'BUILD_COMMAND': '',
112-
'BUILD_COMMAND_TARGET': '',
119+
'BUILD_COMMAND_TARGET': 'build,production,prod,package',
113120
'CLEAN_TARGETS': '.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,*.yml,*.yaml',
114121
'CLEAN_TEST_TAG': 'false',
115122
'COMMIT_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com',
116-
'COMMIT_MESSAGE': 'feat: Build for release',
123+
'COMMIT_MESSAGE': 'feat: build for release',
117124
'COMMIT_NAME': 'github-actions[bot]',
118125
'CREATE_MAJOR_VERSION_TAG': 'true',
119126
'CREATE_MINOR_VERSION_TAG': 'true',
120127
'CREATE_PATCH_VERSION_TAG': 'true',
121128
'FETCH_DEPTH': '3',
129+
'GITHUB_TOKEN': '${{ github.token }}',
122130
'ORIGINAL_TAG_PREFIX': '',
123131
'OUTPUT_BUILD_INFO_FILENAME': '',
124132
'PACKAGE_MANAGER': '',
@@ -132,18 +140,19 @@ describe('getConfig', () => {
132140
it('should get config 4', () => {
133141
expect(getConfig(resolve(fixturesDir, 'test10'), undefined)).toEqual({
134142
'inputs': {
135-
'BRANCH_NAME': 'gh-actions',
143+
'BRANCH_NAME': 'releases/${MAJOR}',
136144
'BUILD_COMMAND': '',
137-
'BUILD_COMMAND_TARGET': '',
145+
'BUILD_COMMAND_TARGET': 'build,production,prod,package',
138146
'CLEAN_TARGETS': '.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,*.yml,*.yaml',
139147
'CLEAN_TEST_TAG': 'false',
140148
'COMMIT_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com',
141-
'COMMIT_MESSAGE': 'feat: Build for release',
149+
'COMMIT_MESSAGE': 'feat: build for release',
142150
'COMMIT_NAME': 'github-actions[bot]',
143151
'CREATE_MAJOR_VERSION_TAG': 'true',
144152
'CREATE_MINOR_VERSION_TAG': 'true',
145153
'CREATE_PATCH_VERSION_TAG': 'true',
146154
'FETCH_DEPTH': '3',
155+
'GITHUB_TOKEN': '${{ github.token }}',
147156
'ORIGINAL_TAG_PREFIX': '',
148157
'OUTPUT_BUILD_INFO_FILENAME': '',
149158
'PACKAGE_MANAGER': '',
@@ -157,18 +166,19 @@ describe('getConfig', () => {
157166
it('should get config 5', () => {
158167
expect(getConfig(resolve(fixturesDir, 'test12'), undefined)).toEqual({
159168
'inputs': {
160-
'BRANCH_NAME': 'gh-actions',
169+
'BRANCH_NAME': 'releases/${MAJOR}',
161170
'BUILD_COMMAND': '',
162-
'BUILD_COMMAND_TARGET': '',
171+
'BUILD_COMMAND_TARGET': 'build,production,prod,package',
163172
'CLEAN_TARGETS': '.[!.]*,__tests__,src,*.js,*.ts,*.json,*.lock,*.yml,*.yaml',
164173
'CLEAN_TEST_TAG': 'false',
165174
'COMMIT_EMAIL': '41898282+github-actions[bot]@users.noreply.github.com',
166-
'COMMIT_MESSAGE': 'feat: Build for release',
175+
'COMMIT_MESSAGE': 'feat: build for release',
167176
'COMMIT_NAME': 'github-actions[bot]',
168177
'CREATE_MAJOR_VERSION_TAG': 'true',
169178
'CREATE_MINOR_VERSION_TAG': 'true',
170179
'CREATE_PATCH_VERSION_TAG': 'true',
171180
'FETCH_DEPTH': '3',
181+
'GITHUB_TOKEN': '${{ github.token }}',
172182
'ORIGINAL_TAG_PREFIX': '',
173183
'OUTPUT_BUILD_INFO_FILENAME': '',
174184
'PACKAGE_MANAGER': '',

__tests__/env.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
/* eslint-disable no-magic-numbers */
22
import { resolve } from 'path';
33
import { testEnv } from '@technote-space/github-action-test-helper';
4+
import { getParams } from '@technote-space/release-github-actions/lib/utils/misc';
45
import { setEnv, loadTokenFromEnv } from '../src/env';
56

67
const fixturesDir = resolve(__dirname, 'fixtures');
8+
beforeEach(() => {
9+
getParams.clear();
10+
});
711

812
describe('setEnv', () => {
913
testEnv();

0 commit comments

Comments
 (0)