Skip to content

Commit bf095b8

Browse files
authored
Merge pull request #284 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.1.0
Bump @docker/actions-toolkit from 0.1.0-beta.19 to 0.1.0
2 parents 3f6690a + 2ed3c45 commit bf095b8

File tree

11 files changed

+1338
-1323
lines changed

11 files changed

+1338
-1323
lines changed

__mocks__/@actions/github.ts

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
import {jest} from '@jest/globals';
2+
3+
export const context = {
4+
repo: {
5+
owner: 'docker',
6+
repo: 'actions-toolkit'
7+
},
8+
ref: 'refs/heads/master',
9+
runId: 123,
10+
payload: {
11+
after: '860c1904a1ce19322e91ac35af1ab07466440c37',
12+
base_ref: null,
13+
before: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
14+
commits: [
15+
{
16+
author: {
17+
18+
name: 'CrazyMax',
19+
username: 'crazy-max'
20+
},
21+
committer: {
22+
23+
name: 'CrazyMax',
24+
username: 'crazy-max'
25+
},
26+
distinct: true,
27+
id: '860c1904a1ce19322e91ac35af1ab07466440c37',
28+
message: 'hello dev',
29+
timestamp: '2022-04-19T11:27:24+02:00',
30+
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
31+
url: 'https://github.com/docker/test-docker-action/commit/860c1904a1ce19322e91ac35af1ab07466440c37'
32+
}
33+
],
34+
compare: 'https://github.com/docker/test-docker-action/compare/5f3331d7f704...860c1904a1ce',
35+
created: false,
36+
deleted: false,
37+
forced: false,
38+
head_commit: {
39+
author: {
40+
41+
name: 'CrazyMax',
42+
username: 'crazy-max'
43+
},
44+
committer: {
45+
46+
name: 'CrazyMax',
47+
username: 'crazy-max'
48+
},
49+
distinct: true,
50+
id: '860c1904a1ce19322e91ac35af1ab07466440c37',
51+
message: 'hello dev',
52+
timestamp: '2022-04-19T11:27:24+02:00',
53+
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
54+
url: 'https://github.com/docker/test-docker-action/commit/860c1904a1ce19322e91ac35af1ab07466440c37'
55+
},
56+
organization: {
57+
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
58+
description: 'Docker helps developers bring their ideas to life by conquering the complexity of app development.',
59+
events_url: 'https://api.github.com/orgs/docker/events',
60+
hooks_url: 'https://api.github.com/orgs/docker/hooks',
61+
id: 5429470,
62+
issues_url: 'https://api.github.com/orgs/docker/issues',
63+
login: 'docker',
64+
members_url: 'https://api.github.com/orgs/docker/members{/member}',
65+
node_id: 'MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=',
66+
public_members_url: 'https://api.github.com/orgs/docker/public_members{/member}',
67+
repos_url: 'https://api.github.com/orgs/docker/repos',
68+
url: 'https://api.github.com/orgs/docker'
69+
},
70+
pusher: {
71+
72+
name: 'crazy-max'
73+
},
74+
ref: 'refs/heads/dev',
75+
repository: {
76+
allow_forking: true,
77+
archive_url: 'https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}',
78+
archived: false,
79+
assignees_url: 'https://api.github.com/repos/docker/test-docker-action/assignees{/user}',
80+
blobs_url: 'https://api.github.com/repos/docker/test-docker-action/git/blobs{/sha}',
81+
branches_url: 'https://api.github.com/repos/docker/test-docker-action/branches{/branch}',
82+
clone_url: 'https://github.com/docker/test-docker-action.git',
83+
collaborators_url: 'https://api.github.com/repos/docker/test-docker-action/collaborators{/collaborator}',
84+
comments_url: 'https://api.github.com/repos/docker/test-docker-action/comments{/number}',
85+
commits_url: 'https://api.github.com/repos/docker/test-docker-action/commits{/sha}',
86+
compare_url: 'https://api.github.com/repos/docker/test-docker-action/compare/{base}...{head}',
87+
contents_url: 'https://api.github.com/repos/docker/test-docker-action/contents/{+path}',
88+
contributors_url: 'https://api.github.com/repos/docker/test-docker-action/contributors',
89+
created_at: 1596792180,
90+
default_branch: 'master',
91+
deployments_url: 'https://api.github.com/repos/docker/test-docker-action/deployments',
92+
description: 'Test "Docker" Actions',
93+
disabled: false,
94+
downloads_url: 'https://api.github.com/repos/docker/test-docker-action/downloads',
95+
events_url: 'https://api.github.com/repos/docker/test-docker-action/events',
96+
fork: false,
97+
forks: 1,
98+
forks_count: 1,
99+
forks_url: 'https://api.github.com/repos/docker/test-docker-action/forks',
100+
full_name: 'docker/test-docker-action',
101+
git_commits_url: 'https://api.github.com/repos/docker/test-docker-action/git/commits{/sha}',
102+
git_refs_url: 'https://api.github.com/repos/docker/test-docker-action/git/refs{/sha}',
103+
git_tags_url: 'https://api.github.com/repos/docker/test-docker-action/git/tags{/sha}',
104+
git_url: 'git://github.com/docker/test-docker-action.git',
105+
has_downloads: true,
106+
has_issues: true,
107+
has_pages: false,
108+
has_projects: true,
109+
has_wiki: true,
110+
homepage: '',
111+
hooks_url: 'https://api.github.com/repos/docker/test-docker-action/hooks',
112+
html_url: 'https://github.com/docker/test-docker-action',
113+
id: 285789493,
114+
is_template: false,
115+
issue_comment_url: 'https://api.github.com/repos/docker/test-docker-action/issues/comments{/number}',
116+
issue_events_url: 'https://api.github.com/repos/docker/test-docker-action/issues/events{/number}',
117+
issues_url: 'https://api.github.com/repos/docker/test-docker-action/issues{/number}',
118+
keys_url: 'https://api.github.com/repos/docker/test-docker-action/keys{/key_id}',
119+
labels_url: 'https://api.github.com/repos/docker/test-docker-action/labels{/name}',
120+
language: 'JavaScript',
121+
languages_url: 'https://api.github.com/repos/docker/test-docker-action/languages',
122+
license: {
123+
key: 'mit',
124+
name: 'MIT License',
125+
node_id: 'MDc6TGljZW5zZTEz',
126+
spdx_id: 'MIT',
127+
url: 'https://api.github.com/licenses/mit'
128+
},
129+
master_branch: 'master',
130+
merges_url: 'https://api.github.com/repos/docker/test-docker-action/merges',
131+
milestones_url: 'https://api.github.com/repos/docker/test-docker-action/milestones{/number}',
132+
mirror_url: null,
133+
name: 'test-docker-action',
134+
node_id: 'MDEwOlJlcG9zaXRvcnkyODU3ODk0OTM=',
135+
notifications_url: 'https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}',
136+
open_issues: 6,
137+
open_issues_count: 6,
138+
organization: 'docker',
139+
owner: {
140+
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
141+
142+
events_url: 'https://api.github.com/users/docker/events{/privacy}',
143+
followers_url: 'https://api.github.com/users/docker/followers',
144+
following_url: 'https://api.github.com/users/docker/following{/other_user}',
145+
gists_url: 'https://api.github.com/users/docker/gists{/gist_id}',
146+
gravatar_id: '',
147+
html_url: 'https://github.com/docker',
148+
id: 5429470,
149+
login: 'docker',
150+
name: 'docker',
151+
node_id: 'MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=',
152+
organizations_url: 'https://api.github.com/users/docker/orgs',
153+
received_events_url: 'https://api.github.com/users/docker/received_events',
154+
repos_url: 'https://api.github.com/users/docker/repos',
155+
site_admin: false,
156+
starred_url: 'https://api.github.com/users/docker/starred{/owner}{/repo}',
157+
subscriptions_url: 'https://api.github.com/users/docker/subscriptions',
158+
type: 'Organization',
159+
url: 'https://api.github.com/users/docker'
160+
},
161+
private: true,
162+
pulls_url: 'https://api.github.com/repos/docker/test-docker-action/pulls{/number}',
163+
pushed_at: 1650360446,
164+
releases_url: 'https://api.github.com/repos/docker/test-docker-action/releases{/id}',
165+
size: 796,
166+
ssh_url: '[email protected]:docker/test-docker-action.git',
167+
stargazers: 0,
168+
stargazers_count: 0,
169+
stargazers_url: 'https://api.github.com/repos/docker/test-docker-action/stargazers',
170+
statuses_url: 'https://api.github.com/repos/docker/test-docker-action/statuses/{sha}',
171+
subscribers_url: 'https://api.github.com/repos/docker/test-docker-action/subscribers',
172+
subscription_url: 'https://api.github.com/repos/docker/test-docker-action/subscription',
173+
svn_url: 'https://github.com/docker/test-docker-action',
174+
tags_url: 'https://api.github.com/repos/docker/test-docker-action/tags',
175+
teams_url: 'https://api.github.com/repos/docker/test-docker-action/teams',
176+
topics: [],
177+
trees_url: 'https://api.github.com/repos/docker/test-docker-action/git/trees{/sha}',
178+
updated_at: '2022-04-19T09:05:09Z',
179+
url: 'https://github.com/docker/test-docker-action',
180+
visibility: 'private',
181+
watchers: 0,
182+
watchers_count: 0
183+
},
184+
sender: {
185+
avatar_url: 'https://avatars.githubusercontent.com/u/1951866?v=4',
186+
events_url: 'https://api.github.com/users/crazy-max/events{/privacy}',
187+
followers_url: 'https://api.github.com/users/crazy-max/followers',
188+
following_url: 'https://api.github.com/users/crazy-max/following{/other_user}',
189+
gists_url: 'https://api.github.com/users/crazy-max/gists{/gist_id}',
190+
gravatar_id: '',
191+
html_url: 'https://github.com/crazy-max',
192+
id: 1951866,
193+
login: 'crazy-max',
194+
node_id: 'MDQ6VXNlcjE5NTE4NjY=',
195+
organizations_url: 'https://api.github.com/users/crazy-max/orgs',
196+
received_events_url: 'https://api.github.com/users/crazy-max/received_events',
197+
repos_url: 'https://api.github.com/users/crazy-max/repos',
198+
site_admin: false,
199+
starred_url: 'https://api.github.com/users/crazy-max/starred{/owner}{/repo}',
200+
subscriptions_url: 'https://api.github.com/users/crazy-max/subscriptions',
201+
type: 'User',
202+
url: 'https://api.github.com/users/crazy-max'
203+
}
204+
}
205+
};
206+
207+
export const getOctokit = jest.fn();

__tests__/context.test.ts

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import {Context} from '@actions/github/lib/context';
2-
import {beforeEach, describe, expect, test, it, jest} from '@jest/globals';
1+
import {afterEach, beforeEach, describe, expect, test, it, jest} from '@jest/globals';
32
import * as dotenv from 'dotenv';
43
import * as fs from 'fs';
54
import * as path from 'path';
6-
import {ContextSource, getInputs, Inputs} from '../src/context';
5+
import {Context} from '@actions/github/lib/context';
6+
import {Git} from '@docker/actions-toolkit/lib/git';
7+
import {GitHub} from '@docker/actions-toolkit/lib/github';
8+
9+
import {ContextSource, getContext, getInputs, Inputs} from '../src/context';
10+
11+
beforeEach(() => {
12+
jest.clearAllMocks();
13+
jest.spyOn(GitHub, 'context', 'get').mockImplementation((): Context => {
14+
return new Context();
15+
});
16+
});
717

818
describe('getInputs', () => {
919
beforeEach(() => {
@@ -66,37 +76,34 @@ describe('getInputs', () => {
6676
});
6777

6878
describe('getContext', () => {
69-
it('get context with workflow', async () => {
70-
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures/event_create_branch.env')));
71-
79+
const originalEnv = process.env;
80+
beforeEach(() => {
7281
jest.resetModules();
73-
// eslint-disable-next-line @typescript-eslint/no-var-requires
74-
const {getContext} = require('../src/context');
75-
const contextResult = await getContext(ContextSource.workflow);
76-
77-
expect(contextResult.ref).toEqual('refs/heads/dev');
78-
expect(contextResult.sha).toEqual('5f3331d7f7044c18ca9f12c77d961c4d7cf3276a');
82+
process.env = {
83+
...originalEnv,
84+
...dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures/event_create_branch.env')))
85+
};
86+
});
87+
afterEach(() => {
88+
process.env = originalEnv;
7989
});
8090

81-
it('get context with git', async () => {
82-
jest.resetModules();
91+
it('workflow', async () => {
92+
const context = await getContext(ContextSource.workflow);
93+
expect(context.ref).toEqual('refs/heads/dev');
94+
expect(context.sha).toEqual('5f3331d7f7044c18ca9f12c77d961c4d7cf3276a');
95+
});
8396

84-
// eslint-disable-next-line @typescript-eslint/no-var-requires
85-
const git = require('@docker/actions-toolkit/lib/git');
86-
jest.spyOn(git.Git, 'context').mockImplementation((): Promise<Context> => {
97+
it('git', async () => {
98+
jest.spyOn(Git, 'context').mockImplementation((): Promise<Context> => {
8799
return Promise.resolve({
88100
ref: 'refs/heads/git-test',
89101
sha: 'git-test-sha'
90102
} as Context);
91103
});
92-
93-
// eslint-disable-next-line @typescript-eslint/no-var-requires
94-
const {getContext} = require('../src/context');
95-
96-
const contextResult = await getContext(ContextSource.git);
97-
98-
expect(contextResult.ref).toEqual('refs/heads/git-test');
99-
expect(contextResult.sha).toEqual('git-test-sha');
104+
const context = await getContext(ContextSource.git);
105+
expect(context.ref).toEqual('refs/heads/git-test');
106+
expect(context.sha).toEqual('git-test-sha');
100107
});
101108
});
102109

__tests__/image.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('transform', () => {
8787
[
8888
[`name/foo,name=name/bar,enable=true`], undefined, true
8989
]
90-
])('given %p', async (l: string[], expected: Image[], invalid: boolean) => {
90+
])('given %p', async (l: string[], expected: Image[] | undefined, invalid: boolean) => {
9191
try {
9292
const images = Transform(l);
9393
expect(images).toEqual(expected);

__tests__/meta.test.ts

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import * as dotenv from 'dotenv';
55
import {GitHub} from '@docker/actions-toolkit/lib/github';
66
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
77
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
8-
import {ContextSource, getInputs, Inputs} from '../src/context';
8+
import {Context} from '@actions/github/lib/context';
9+
10+
import {ContextSource, getContext, getInputs, Inputs} from '../src/context';
911
import {Meta, Version} from '../src/meta';
1012

1113
import repoFixture from './fixtures/repo.json';
14+
1215
jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise<GitHubRepo> => {
1316
return <Promise<GitHubRepo>>(repoFixture as unknown);
1417
});
@@ -21,24 +24,16 @@ jest.mock('moment-timezone', () => {
2124
return () => (jest.requireActual('moment-timezone') as typeof import('moment-timezone'))('2020-01-10T00:30:00.000Z');
2225
});
2326

24-
/**
25-
* Get a workflow context based on the current environment variables.
26-
*/
27-
const getFreshWorkflowContext = async () => {
28-
jest.resetModules();
29-
// eslint-disable-next-line @typescript-eslint/no-var-requires
30-
const {getContext} = require('../src/context');
31-
const context = await getContext(ContextSource.workflow);
32-
return context;
33-
};
34-
3527
beforeEach(() => {
3628
jest.clearAllMocks();
3729
Object.keys(process.env).forEach(function (key) {
3830
if (key !== 'GITHUB_TOKEN' && key.startsWith('GITHUB_')) {
3931
delete process.env[key];
4032
}
4133
});
34+
jest.spyOn(GitHub, 'context', 'get').mockImplementation((): Context => {
35+
return new Context();
36+
});
4237
});
4338

4439
describe('isRawStatement', () => {
@@ -58,8 +53,7 @@ const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exV
5853
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
5954
const toolkit = new Toolkit();
6055
const repo = await toolkit.github.repoData();
61-
const context = await getFreshWorkflowContext();
62-
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
56+
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
6357

6458
const version = meta.version;
6559
expect(version).toEqual(exVersion);
@@ -2776,8 +2770,7 @@ describe('pr-head-sha', () => {
27762770

27772771
const toolkit = new Toolkit();
27782772
const repo = await toolkit.github.repoData();
2779-
const context = await getFreshWorkflowContext();
2780-
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
2773+
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
27812774

27822775
const version = meta.version;
27832776
expect(version).toEqual(exVersion);
@@ -3719,8 +3712,7 @@ describe('json', () => {
37193712

37203713
const toolkit = new Toolkit();
37213714
const repo = await toolkit.github.repoData();
3722-
const context = await getFreshWorkflowContext();
3723-
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
3715+
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
37243716

37253717
const jsonOutput = meta.getJSON();
37263718
expect(jsonOutput).toEqual(exJSON);
@@ -4026,8 +4018,7 @@ describe('bake', () => {
40264018

40274019
const toolkit = new Toolkit();
40284020
const repo = await toolkit.github.repoData();
4029-
const context = await getFreshWorkflowContext();
4030-
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
4021+
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
40314022

40324023
const bakeFile = meta.getBakeFile();
40334024
expect(JSON.parse(fs.readFileSync(bakeFile, 'utf8'))).toEqual(exBakeDefinition);
@@ -4069,13 +4060,12 @@ describe('sepTags', () => {
40694060
"user/app:dev,user/app:my,user/app:custom,user/app:tags"
40704061
]
40714062
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, expTags: string) => {
4072-
4063+
40734064
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
4074-
4065+
40754066
const toolkit = new Toolkit();
40764067
const repo = await toolkit.github.repoData();
4077-
const context = await getFreshWorkflowContext();
4078-
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
4068+
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
40794069

40804070
expect(meta.getTags().join(inputs.sepTags)).toEqual(expTags);
40814071
});

dist/index.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sourcemap-register.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)