Skip to content

Commit

Permalink
chore: changes for upgrading to actions/github 6.0.0 (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed May 28, 2024
1 parent d061465 commit 4b4a3d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/scripts/update-platform-executables.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const core = require('@actions/core');
const { GitHub } = require('@actions/github');
const github = require('@actions/github');
const fs = require('fs');

/**
Expand All @@ -15,12 +15,12 @@ const updatePlatformExecutables = async () => {
return;
}
}
const github = new GitHub(process.env.GITHUB_TOKEN);
const octokit = new github.getOctokit(process.env.GITHUB_TOKEN);
const [owner, repo] = process.env.REPO_NAME
? process.env.REPO_NAME.split('/')
: [null, null];
const tag = process.env.TAG_NAME;
const getReleaseResponse = await github.repos.getReleaseByTag({
const getReleaseResponse = await octokit.rest.repos.getReleaseByTag({
owner,
repo,
tag
Expand Down Expand Up @@ -57,7 +57,7 @@ const updatePlatformExecutables = async () => {
const file_bytes = fs.readFileSync(file);

// Check for duplicates.
const assets = await github.repos.listAssetsForRelease(
const assets = await octokit.rest.repos.listReleaseAssets(
{
owner,
repo,
Expand All @@ -69,7 +69,7 @@ const updatePlatformExecutables = async () => {
core.debug(
`An asset called ${assetName} already exists in release ${tag} so we'll overwrite it.`
)
await github.repos.deleteReleaseAsset({
await octokit.rest.repos.deleteReleaseAsset({
owner,
repo,
asset_id: duplicate_asset.id
Expand All @@ -85,7 +85,7 @@ const updatePlatformExecutables = async () => {
}

core.debug(`Uploading ${file} to ${assetName} in release ${tag}.`)
const uploaded_asset = await github.repos.uploadReleaseAsset(
const uploaded_asset = await octokit.rest.repos.uploadReleaseAsset(
{
url: oldUploadUrl,
name: assetName,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"ngrok": "^4.3.3"
},
"engines": {
"node": ">=18.0.0"
"node": ">=18.17"
},
"oclif": {
"commands": "./src/commands",
Expand Down

0 comments on commit 4b4a3d6

Please sign in to comment.