Skip to content
Merged
1 change: 1 addition & 0 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ describe('main', () => {
'[command]git config --global \'init.defaultBranch\' master',
' >> stdout',
'::group::Total:0 Succeeded:0 Failed:0 Skipped:0',
'',
'::set-output name=result::skipped',
'::endgroup::',
]);
Expand Down
11 changes: 11 additions & 0 deletions __tests__/utils/process1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] has been closed because there is no reference diff',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -238,6 +239,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Deleting reference... [refs/heads/Hello-World/test-21031067]',
'::endgroup::',
'',
'::set-output name=result::succeeded',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-feature] has been closed because there is no reference diff',
]);
Expand Down Expand Up @@ -330,6 +332,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Deleting reference... [refs/heads/Hello-World/test-21031067]',
'::endgroup::',
'',
'::set-output name=result::succeeded',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-feature] has been closed because there is no reference diff',
]);
Expand Down Expand Up @@ -375,6 +378,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] has been closed because base PullRequest has been closed',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -468,6 +472,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] has been closed because there is no reference diff',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -513,6 +518,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] has been closed because base PullRequest does not exist',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -548,6 +554,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:2 Skipped:0',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic1] not found',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -582,6 +589,7 @@ describe('execute', () => {
'> \x1b[33;40m→\x1b[0m\t[feature/new-topic3] This is not a target branch',
'> \x1b[33;40m→\x1b[0m\t[feature/new-topic4] This is not a target branch',
'> \x1b[31;40m×\x1b[0m\t[master] parameter [prBranchName] is required.',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -610,6 +618,7 @@ describe('execute', () => {
'> \x1b[33;40m→\x1b[0m\t[fork1:feature/new-topic3] PR from fork',
'> \x1b[33;40m→\x1b[0m\t[fork2:feature/new-topic4] PR from fork',
'> \x1b[31;40m×\x1b[0m\t[master] parameter [prBranchName] is required.',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -690,6 +699,7 @@ describe('execute', () => {
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
' >> stdout',
'[command]git diff \'HEAD..origin/feature/new-feature\' --name-only',
'',
'::set-output name=result::not changed',
'::endgroup::',
'> \x1b[33;40m✔\x1b[0m\t[feature/new-feature] There is no diff',
Expand Down Expand Up @@ -737,6 +747,7 @@ describe('execute', () => {
'[command]git add --all',
'[command]git status --short -uno',
'> There is no diff.',
'',
'::set-output name=result::not changed',
'::endgroup::',
'> \x1b[33;40m✔\x1b[0m\t[test/change] There is no diff',
Expand Down
20 changes: 20 additions & 0 deletions __tests__/utils/process2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ describe('execute', () => {
'[command]git push origin Hello-World/test-21031067:refs/heads/Hello-World/test-21031067',
'::endgroup::',
'::group::Creating comment to PullRequest...',
'',
'::set-output name=result::succeeded',
'::endgroup::',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-feature] updated',
Expand Down Expand Up @@ -231,6 +232,7 @@ describe('execute', () => {
'::group::Checking references diff...',
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
'[command]git diff \'HEAD..origin/feature/new-feature\' --name-only',
'',
'::set-output name=result::not changed',
'::endgroup::',
'> \x1b[33;40m✔\x1b[0m\t[feature/new-feature] There is no diff',
Expand Down Expand Up @@ -340,6 +342,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:0 Skipped:2',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic1] This is a close event',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic2] This is a close event',
'',
'::set-output name=result::not changed',
'::endgroup::',
]);
Expand Down Expand Up @@ -421,6 +424,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:0 Skipped:2',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic1] This is a close event',
'> \x1b[33;40m→\x1b[0m\t[change/new-topic2] duplicated (test/test-branch)',
'',
'::set-output name=result::not changed',
'::endgroup::',
]);
Expand Down Expand Up @@ -513,6 +517,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:1 Skipped:1',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic1] This is a close event',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -573,6 +578,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Pushing to octocat/Hello-World@test...',
'[command]git push origin test:refs/heads/test',
'',
'::set-output name=result::succeeded',
'::endgroup::',
'> \x1b[32;40m✔\x1b[0m\t[test] updated',
Expand Down Expand Up @@ -652,6 +658,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Pushing to octocat/Hello-World@feature/new-feature...',
'[command]git push origin feature/new-feature:refs/heads/feature/new-feature',
'',
'::set-output name=result::succeeded',
'::endgroup::',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-feature] updated',
Expand Down Expand Up @@ -748,6 +755,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] updated',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -844,6 +852,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:0 Skipped:1',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-topic3] updated',
'> \x1b[33;40m→\x1b[0m\t[feature/new-topic4] duplicated (Hello-World/test-branch)',
'',
'::set-output name=result::succeeded',
'::endgroup::',
]);
Expand Down Expand Up @@ -935,6 +944,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:1 Skipped:1',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic1] There is no diff',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -1024,6 +1034,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:1 Skipped:1',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic1] There is no diff',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -1117,6 +1128,7 @@ describe('execute', () => {
'> \x1b[33;40m→\x1b[0m\t[change/new-topic1] This is not a target branch',
'> \x1b[33;40m→\x1b[0m\t[change/new-topic2] This is not a target branch',
'> \x1b[32;40m✔\x1b[0m\t[master] updated',
'',
'::set-output name=result::succeeded',
'::endgroup::',
]);
Expand Down Expand Up @@ -1192,6 +1204,7 @@ describe('execute', () => {
'> \x1b[31;40m×\x1b[0m\t[feature/new-topic3] command [git status] exited with code undefined. message: test error',
'> \x1b[33;40m→\x1b[0m\t[feature/new-topic4] duplicated (Hello-World/test-branch)',
'> \x1b[33;40m→\x1b[0m\t[master] duplicated (Hello-World/test-branch)',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -1300,6 +1313,7 @@ describe('execute', () => {
'> \x1b[31;40m×\x1b[0m\t[change/new-topic1] command [git status] exited with code undefined. message: test error',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'> \x1b[31;40m×\x1b[0m\t[master] command [git status] exited with code undefined. message: test error',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -1388,6 +1402,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Pushing to octocat/Hello-World@Hello-World/test-21031067...',
'[command]git push origin Hello-World/test-21031067:refs/heads/Hello-World/test-21031067',
'',
'::set-output name=result::succeeded',
'::endgroup::',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-feature] updated',
Expand Down Expand Up @@ -1496,6 +1511,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] has been closed because there is no diff',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -1644,6 +1660,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Pushing to octocat/Hello-World@test/change...',
'[command]git push origin test/change:refs/heads/test/change',
'',
'::set-output name=result::succeeded',
'::endgroup::',
'> \x1b[32;40m✔\x1b[0m\t[test/change] updated',
Expand Down Expand Up @@ -1730,6 +1747,7 @@ describe('execute', () => {
'::group::Creating PullRequest...',
'> Adding labels...',
getLogStdout(['label1', 'label2']),
'',
'::set-output name=result::succeeded',
'::endgroup::',
'> \x1b[32;40m✔\x1b[0m\t[feature/new-feature] PullRequest created',
Expand Down Expand Up @@ -1844,6 +1862,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:1 Failed:1 Skipped:0',
'> \x1b[32;40m✔\x1b[0m\t[change/new-topic1] has been auto merged',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down Expand Up @@ -1950,6 +1969,7 @@ describe('execute', () => {
'::group::Total:2 Succeeded:0 Failed:1 Skipped:1',
'> \x1b[33;40m✔\x1b[0m\t[change/new-topic1] There is no diff',
'> \x1b[31;40m×\x1b[0m\t[change/new-topic2] not found',
'',
'::set-output name=result::failed',
'::endgroup::',
]);
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@technote-space/github-action-pr-helper",
"version": "2.2.5",
"version": "2.2.6",
"description": "PullRequest Helper for GitHub Actions.",
"keywords": [
"github",
Expand Down Expand Up @@ -31,36 +31,36 @@
"lint": "eslint 'src/**/*.ts' '__tests__/**/*.ts' --cache",
"lint:fix": "eslint --fix 'src/**/*.ts' '__tests__/**/*.ts'",
"test": "yarn lint && yarn cover",
"update": "npx npm-check-updates -u && yarn install && yarn upgrade && yarn audit",
"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"
},
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/core": "^1.2.7",
"@actions/github": "^4.0.0",
"@octokit/openapi-types": "^5.3.2",
"@technote-space/filter-github-action": "^0.5.21",
"@technote-space/github-action-helper": "^5.2.3",
"@octokit/openapi-types": "^6.2.1",
"@technote-space/filter-github-action": "^0.5.24",
"@technote-space/github-action-helper": "^5.2.6",
"moment": "^2.29.1"
},
"devDependencies": {
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@technote-space/github-action-test-helper": "^0.7.3",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.32",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"eslint": "^7.21.0",
"husky": "^5.1.3",
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@technote-space/github-action-test-helper": "^0.7.8",
"@types/jest": "^26.0.23",
"@types/node": "^15.0.1",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint": "^7.25.0",
"husky": "^6.0.0",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"lint-staged": "^10.5.4",
"nock": "^13.0.11",
"pinst": "^2.1.6",
"ts-jest": "^26.5.3",
"typescript": "^4.2.3"
"ts-jest": "^26.5.5",
"typescript": "^4.2.4"
},
"publishConfig": {
"access": "public"
Expand Down
Loading