Skip to content

Commit e9cb328

Browse files
Merge pull request #304 from technote-space/release/next-v3.4.0
release: v3.5.0
2 parents 5e49d35 + 44e65b9 commit e9cb328

File tree

5 files changed

+149
-143
lines changed

5 files changed

+149
-143
lines changed

__tests__/git-helper.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('GitHelper', () => {
124124

125125
execCalledWith(mockExec, [
126126
'git remote add origin \'https://octocat:token1@github.com/hello/world.git\' > /dev/null 2>&1 || :',
127-
'git fetch --no-tags origin \'refs/pull/123/merge:refs/pull/123/merge\' || :',
127+
'git fetch --no-tags origin \'refs/pull/123/merge:refs/remotes/origin/pull/123/merge\' || :',
128128
'git checkout -qf test-sha',
129129
]);
130130
});

__tests__/utils2.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe('getRefspec', () => {
170170
expect(getRefspec('master')).toBe('refs/heads/master:refs/remotes/origin/master');
171171
expect(getRefspec('refs/heads/master', 'test')).toBe('refs/heads/master:refs/remotes/test/master');
172172
expect(getRefspec('refs/tags/v1.2.3')).toBe('refs/tags/v1.2.3:refs/tags/v1.2.3');
173-
expect(getRefspec('refs/pull/123/merge')).toBe('refs/pull/123/merge:refs/pull/123/merge');
173+
expect(getRefspec('refs/pull/123/merge')).toBe('refs/pull/123/merge:refs/remotes/origin/pull/123/merge');
174174
});
175175
});
176176

@@ -188,7 +188,7 @@ describe('getLocalRefspec', () => {
188188
expect(getLocalRefspec('master')).toBe('origin/master');
189189
expect(getLocalRefspec('refs/heads/master', 'test')).toBe('test/master');
190190
expect(getLocalRefspec('refs/tags/v1.2.3')).toBe('tags/v1.2.3');
191-
expect(getLocalRefspec('refs/pull/123/merge')).toBe('pull/123/merge');
191+
expect(getLocalRefspec('refs/pull/123/merge')).toBe('origin/pull/123/merge');
192192
});
193193
});
194194

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@technote-space/github-action-helper",
3-
"version": "3.4.0",
3+
"version": "3.5.0",
44
"description": "Helper for GitHub Action.",
55
"author": {
66
"name": "Technote",
@@ -28,23 +28,23 @@
2828
"dependencies": {
2929
"@actions/core": "^1.2.5",
3030
"@actions/github": "^4.0.0",
31-
"@octokit/plugin-rest-endpoint-methods": "^4.1.3",
31+
"@octokit/plugin-rest-endpoint-methods": "^4.1.4",
3232
"shell-escape": "^0.2.0",
3333
"sprintf-js": "^1.1.2"
3434
},
3535
"devDependencies": {
3636
"@commitlint/cli": "^9.1.2",
3737
"@commitlint/config-conventional": "^9.1.2",
38-
"@technote-space/github-action-test-helper": "^0.5.6",
39-
"@types/jest": "^26.0.12",
40-
"@types/node": "^14.6.2",
41-
"@typescript-eslint/eslint-plugin": "^4.0.1",
42-
"@typescript-eslint/parser": "^4.0.1",
43-
"eslint": "^7.8.0",
44-
"husky": "^4.2.5",
38+
"@technote-space/github-action-test-helper": "^0.5.7",
39+
"@types/jest": "^26.0.13",
40+
"@types/node": "^14.10.0",
41+
"@typescript-eslint/eslint-plugin": "^4.1.0",
42+
"@typescript-eslint/parser": "^4.1.0",
43+
"eslint": "^7.8.1",
44+
"husky": "^4.3.0",
4545
"jest": "^26.4.2",
4646
"jest-circus": "^26.4.2",
47-
"lint-staged": "^10.2.13",
47+
"lint-staged": "^10.3.0",
4848
"nock": "^13.0.4",
4949
"ts-jest": "^26.3.0",
5050
"typescript": "^4.0.2"

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const trimRef = (ref: string | RefObject): string => getRef(ref).replace(
6767

6868
export const getTag = (ref: string | RefObject): string => isTagRef(ref) ? trimRef(ref) : '';
6969

70-
const saveTarget = (ref: string | RefObject, origin: string): string => isTagRef(ref) ? 'tags' : isPrRef(ref) ? 'pull' : origin;
70+
const saveTarget = (ref: string | RefObject, origin: string): string => isTagRef(ref) ? 'tags' : isPrRef(ref) ? `${origin}/pull` : origin;
7171

7272
// e.g.
7373
// refs/heads/master
@@ -77,7 +77,7 @@ export const getRemoteRefspec = (ref: string | RefObject): string => normalizeRe
7777

7878
// e.g.
7979
// origin/master
80-
// pull/123/merge
80+
// origin/pull/123/merge
8181
// tags/v1.2.3
8282
export const getLocalRefspec = (ref: string | RefObject, origin = 'origin'): string => `${saveTarget(ref, origin)}/${trimRef(ref)}`;
8383

0 commit comments

Comments
 (0)