Skip to content

Commit

Permalink
Update dependencies (#15)
Browse files Browse the repository at this point in the history
- Updated dependencies
- Upgraded from node `12` to `20`
- Replaced deprecated `@zeit/ncc` @ for `@vercel/ncc`
  • Loading branch information
dobladov authored Feb 13, 2024
1 parent d6fbe08 commit ef27888
Show file tree
Hide file tree
Showing 9 changed files with 1,419 additions and 1,526 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.1.0
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

- Updated dependencies
- Upgraded from node `12` to `20`
- Replaced deprecated `@zeit/ncc` @ for `@vercel/ncc`

## 1.1.0

Add `auto_merge` parameter to `createDeployment`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
deploy:
name: Deploy
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: # your delivery scripts
- name: Success
if: success()
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inputs:
description: 'Sets the URL for accessing your environment'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'dist/index.js'
branding:
icon: upload
Expand Down
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ async function run() {
const {context} = github;
const {repo} = context;

/** @type {state} */
const state = core.getInput('state', {required: true});
const state = /** @type {state} */(core.getInput('state', {required: true}));
const token = core.getInput('token', {required: true});
const description = core.getInput('description');
const environment = core.getInput('environment') || 'live';
const environment_url = core.getInput('environment_url');

const octokit = new github.GitHub(token, {previews: ['flash', 'ant-man']});
const octokit = github.getOctokit(token, {previews: ['flash', 'ant-man']});

const deploy = await octokit.repos.createDeployment({
const deploy = await octokit.rest.repos.createDeployment({
description,
environment,
owner: repo.owner,
Expand All @@ -26,16 +25,17 @@ async function run() {
auto_merge: false,
});

await octokit.repos.createDeploymentStatus({
await octokit.rest.repos.createDeploymentStatus({
...repo,
// @ts-ignore The id could be undefined if the deployment was not created
deployment_id: deploy.data.id,
description,
environment_url,
log_url: `https://github.com/${repo.owner}/${repo.repo}/commit/${context.sha}/checks`,
state,
});
} catch (error) {
core.setFailed(error.message);
core.setFailed(error instanceof Error ? error.message : 'Unknown error');
}
}

Expand Down
Loading

0 comments on commit ef27888

Please sign in to comment.