Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions __tests__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('getActionDefaultInputs', () => {
'CREATE_MAJOR_VERSION_TAG': 'true',
'CREATE_MINOR_VERSION_TAG': 'true',
'CREATE_PATCH_VERSION_TAG': 'true',
'DELETE_NODE_MODULES': 'false',
'FETCH_DEPTH': '3',
'GITHUB_TOKEN': '${{ github.token }}',
'ORIGINAL_TAG_PREFIX': '',
Expand All @@ -74,6 +75,7 @@ describe('getConfig', () => {
'CREATE_MAJOR_VERSION_TAG': 'true',
'CREATE_MINOR_VERSION_TAG': 'true',
'CREATE_PATCH_VERSION_TAG': 'true',
'DELETE_NODE_MODULES': 'false',
'FETCH_DEPTH': '5',
'GITHUB_TOKEN': '${{ github.token }}',
'ORIGINAL_TAG_PREFIX': '',
Expand Down Expand Up @@ -102,6 +104,7 @@ describe('getConfig', () => {
'CREATE_MAJOR_VERSION_TAG': 'true',
'CREATE_MINOR_VERSION_TAG': 'true',
'CREATE_PATCH_VERSION_TAG': 'true',
'DELETE_NODE_MODULES': 'false',
'FETCH_DEPTH': '3',
'GITHUB_TOKEN': '${{ github.token }}',
'ORIGINAL_TAG_PREFIX': '',
Expand Down Expand Up @@ -129,6 +132,7 @@ describe('getConfig', () => {
'CREATE_MAJOR_VERSION_TAG': 'true',
'CREATE_MINOR_VERSION_TAG': 'true',
'CREATE_PATCH_VERSION_TAG': 'true',
'DELETE_NODE_MODULES': 'false',
'FETCH_DEPTH': '3',
'GITHUB_TOKEN': '${{ github.token }}',
'ORIGINAL_TAG_PREFIX': '',
Expand Down Expand Up @@ -156,6 +160,7 @@ describe('getConfig', () => {
'CREATE_MAJOR_VERSION_TAG': 'true',
'CREATE_MINOR_VERSION_TAG': 'true',
'CREATE_PATCH_VERSION_TAG': 'true',
'DELETE_NODE_MODULES': 'false',
'FETCH_DEPTH': '3',
'GITHUB_TOKEN': '${{ github.token }}',
'ORIGINAL_TAG_PREFIX': '',
Expand Down Expand Up @@ -183,6 +188,7 @@ describe('getConfig', () => {
'CREATE_MAJOR_VERSION_TAG': 'true',
'CREATE_MINOR_VERSION_TAG': 'true',
'CREATE_PATCH_VERSION_TAG': 'true',
'DELETE_NODE_MODULES': 'false',
'FETCH_DEPTH': '3',
'GITHUB_TOKEN': '${{ github.token }}',
'ORIGINAL_TAG_PREFIX': '',
Expand Down
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@technote-space/release-github-actions-cli",
"version": "1.8.7",
"version": "1.8.8",
"description": "Release GitHub Actions Cli",
"keywords": [
"github",
Expand Down Expand Up @@ -31,40 +31,40 @@
"scripts": {
"build": "yarn install && tsc && yarn install --production",
"cover": "jest --coverage",
"postinstall": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/husky ] || husky install",
"lint": "eslint 'src/**/*.ts' '__tests__/**/*.ts' --cache",
"lint:fix": "eslint --fix 'src/**/*.ts' '__tests__/**/*.ts'",
"prepublishOnly": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --disable",
"postpublish": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --enable",
"release": "./bin/release-ga",
"test": "yarn lint && yarn cover",
"update": "npm_config_yes=true npx npm-check-updates -u --timeout 100000 && yarn install && yarn upgrade && yarn audit",
"postinstall": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/husky ] || husky install",
"prepublishOnly": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --disable",
"postpublish": "[ -n \"$CI\" ] || [ ! -f node_modules/.bin/pinst ] || pinst --enable"
"update": "npm_config_yes=true npx npm-check-updates -u --timeout 100000 && yarn install && yarn upgrade && yarn audit"
},
"dependencies": {
"@technote-space/github-action-helper": "^5.2.20",
"@technote-space/github-action-log-helper": "^0.1.40",
"@technote-space/release-github-actions": "^7.0.7",
"commander": "^8.1.0",
"@technote-space/github-action-helper": "^5.2.23",
"@technote-space/github-action-log-helper": "^0.1.41",
"@technote-space/release-github-actions": "^7.1.0",
"commander": "^8.3.0",
"cosmiconfig": "^7.0.1",
"dotenv": "^10.0.0",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@technote-space/github-action-test-helper": "^0.7.27",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.10",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"eslint": "^7.32.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"jest-circus": "^27.1.0",
"lint-staged": "^11.1.2",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@technote-space/github-action-test-helper": "^0.7.28",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"eslint": "^8.2.0",
"husky": "^7.0.4",
"jest": "^27.3.1",
"jest-circus": "^27.3.1",
"lint-staged": "^11.2.6",
"pinst": "^2.1.6",
"ts-jest": "^27.0.5",
"typescript": "^4.4.2"
"ts-jest": "^27.0.7",
"typescript": "^4.4.4"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {Config} from './types';
import {cosmiconfigSync} from 'cosmiconfig';
import {existsSync, readFileSync} from 'fs';
import {resolve} from 'path';
import {load} from 'js-yaml';
import {getRepository} from './misc';
import {Config} from './types';

export const normalizeConfigKey = (key: string): string => key.replace(/[-\s]+/g, '_').toUpperCase();

Expand Down
2 changes: 1 addition & 1 deletion src/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Config} from './types';
import dotenv from 'dotenv';
import {existsSync, readFileSync} from 'fs';
import {resolve} from 'path';
import {Config} from './types';

export const loadTokenFromEnv = (dir: string): string | undefined => {
if (!existsSync(resolve(dir, '.env'))) {
Expand Down
4 changes: 2 additions & 2 deletions src/misc.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {Context} from '@actions/github/lib/context';
import type {Config, ContextArgs} from './types';
import {readFileSync} from 'fs';
import {resolve} from 'path';
import {Context} from '@actions/github/lib/context';
import {GitHelper} from '@technote-space/github-action-helper';
import {Logger} from '@technote-space/github-action-log-helper';
import {Config, ContextArgs} from './types';

export const getRepository = (dir: string): { owner: string; repo: string } | never => {
const json = JSON.parse(readFileSync(resolve(dir, 'package.json'), {encoding: 'utf8'}));
Expand Down
7 changes: 4 additions & 3 deletions src/wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type {Context} from '@actions/github/lib/context';
import type {GitHelper} from '@technote-space/github-action-helper';
import type {ContextArgs} from './types';
import {mkdirSync} from 'fs';
import {Context} from '@actions/github/lib/context';
import {GitHelper, Command} from '@technote-space/github-action-helper';
import {Command} from '@technote-space/github-action-helper';
import {Logger} from '@technote-space/github-action-log-helper';
import * as command from '@technote-space/release-github-actions/lib/utils/command';
import * as misc from '@technote-space/release-github-actions/lib/utils/misc';
import {getContext} from './misc';
import {ContextArgs} from './types';

export const isValidContext = (args: ContextArgs): boolean => misc.isValidContext(getContext(args));

Expand Down
Loading