Skip to content

Commit

Permalink
Use Node 16
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Oct 21, 2022
1 parent a0b3ff1 commit 21b5956
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion __tests__/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('refExists', () => {
test('returns true for existing refs', async () => {
await execa('git', ['tag', 'a-tag']);
expect(await git.refExists('HEAD')).toBe(true);
expect(await git.refExists('master')).toBe(true);
expect(await git.refExists('main')).toBe(true);
expect(await git.refExists('a-tag')).toBe(true);
});

Expand Down
4 changes: 2 additions & 2 deletions __tests__/helpers/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function initRepository(dir: string): Promise<void> {
fs.mkdirSync(dir);
}

await execa('git', ['init'], { cwd: dir });
await execa('git', ['init', '-b', 'main'], { cwd: dir });
await execa('git', ['config', 'user.name', 'Test User'], { cwd: dir });
await execa('git', ['config', 'user.email', 'test@example.com'], { cwd: dir });
await execa('git', ['commit', '--allow-empty', '-m', 'initial commit'], { cwd: dir });
Expand All @@ -15,5 +15,5 @@ export async function initRepository(dir: string): Promise<void> {
export async function addAndTrackRemote(name: string, url: string): Promise<void> {
await execa('git', ['remote', 'add', name, url]);
await execa('git', ['fetch', '--all']);
await execa('git', ['branch', '--set-upstream-to', `${name}/master`]);
await execa('git', ['branch', '--set-upstream-to', `${name}/main`]);
}
2 changes: 1 addition & 1 deletion __tests__/helpers/scratch-directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export function runTestsInScratchDirectory(): void {

afterEach(async () => {
process.chdir(cwd);
fs.rmdirSync(testDir, { recursive: true });
fs.rmSync(testDir, { recursive: true, force: true });
});
}
6 changes: 3 additions & 3 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('with a changed version', () => {
test('creates a new tag', async () => {
let result = await execa.node(`${__dirname}/../lib/main.js`, {
env: {
GITHUB_REF: 'master',
GITHUB_REF: 'main',
},
});

Expand All @@ -46,7 +46,7 @@ describe('with a changed version', () => {
test('skips tag creation when configured to', async () => {
let result = await execa.node(`${__dirname}/../lib/main.js`, {
env: {
GITHUB_REF: 'master',
GITHUB_REF: 'main',
'INPUT_CREATE-TAG': 'false',
},
});
Expand All @@ -67,7 +67,7 @@ describe('with no version change', () => {

let result = await execa.node(`${__dirname}/../lib/main.js`, {
env: {
GITHUB_REF: 'master',
GITHUB_REF: 'main',
},
});

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ outputs:
tag:
description: if a new tag is created, this output will contain its name
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
branding:
icon: tag
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/execa": "^2.0.0",
"@types/glob": "^7.1.1",
"@types/jest": "^24.0.23",
"@types/node": "^12.7.12",
"@types/node": "^16.0.0",
"@typescript-eslint/parser": "^2.8.0",
"@zeit/ncc": "^0.20.5",
"eslint": "^6.8.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.1.tgz#238eb34a66431b71d2aaddeaa7db166f25971a0d"
integrity sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA==

"@types/node@^12.7.12":
version "12.12.27"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.27.tgz#d7506f73160ad30fcebbcf5b8b7d2d976e649e42"
integrity sha512-odQFl/+B9idbdS0e8IxDl2ia/LP8KZLXhV3BUeI98TrZp0uoIzQPhGd+5EtzHmT0SMOIaPd7jfz6pOHLWTtl7A==
"@types/node@^16.0.0":
version "16.11.68"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.68.tgz#30ee923f4d940793e0380f5ce61c0bd4b7196b6c"
integrity sha512-JkRpuVz3xCNCWaeQ5EHLR/6woMbHZz/jZ7Kmc63AkU+1HxnoUugzSWMck7dsR4DvNYX8jp9wTi9K7WvnxOIQZQ==

"@types/stack-utils@^1.0.1":
version "1.0.1"
Expand Down

0 comments on commit 21b5956

Please sign in to comment.