Skip to content

Commit

Permalink
add outputs of unmerged PR. Updated node up to v20, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
timpuida committed Nov 12, 2024
1 parent 0b8d9f4 commit 8882d68
Show file tree
Hide file tree
Showing 5 changed files with 1,625 additions and 1,021 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/dist
/node_modules
tsconfig.tsbuildinfo
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ inputs:
github_token:
description: Token for the GitHub API.
default: ${{ github.token }}
outputs:
unmerged_pr:
description: The PR that could not be merged automatically.
runs:
using: node16
using: node20
main: dist/index.js
branding:
icon: refresh-cw
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
"xo": "xo"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0",
"ensure-error": "^4.0.0"
},
"devDependencies": {
"@octokit/plugin-paginate-rest": "^5.0.1",
"@octokit/plugin-paginate-rest": "^11.3.5",
"@octokit/webhooks-definitions": "^3.67.3",
"@types/node": "^16.11.7",
"@vercel/ncc": "^0.34.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"eslint-plugin-typescript-sort-keys": "^2.1.0",
"prettier": "^2.8.0",
"prettier-plugin-packagejson": "^2.3.0",
"typescript": "^4.9.3",
"xo": "^0.53.1",
"yarn-deduplicate": "^6.0.0"
"@types/node": "^20.17.6",
"@vercel/ncc": "^0.38.2",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"eslint-plugin-typescript-sort-keys": "^3.3.0",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"typescript": "^5.6.3",
"xo": "^0.59.3",
"yarn-deduplicate": "^6.0.2"
}
}
13 changes: 11 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { getInput, group, info, setFailed, warning } from "@actions/core";
import {
getInput,
group,
info,
setFailed,
warning,
setOutput,
} from "@actions/core";
import { context, getOctokit } from "@actions/github";
import type { GitHub } from "@actions/github/lib/utils.js";
import type { PaginatingEndpoints } from "@octokit/plugin-paginate-rest";
Expand All @@ -19,13 +26,13 @@ const handleUnupdatablePullRequest = async (
octokit: InstanceType<typeof GitHub>;
}>,
): Promise<void> => {
const { number } = pullRequest;
try {
const {
head: {
repo: { full_name },
sha,
},
number,
} = pullRequest;

const [owner, repo] = full_name.split("/");
Expand Down Expand Up @@ -75,6 +82,8 @@ const handleUnupdatablePullRequest = async (

info(`Commented: ${newComment.html_url}`);
} catch (error: unknown) {
const { owner, repo } = context.repo;
setOutput("unmerged_pr", `/${owner}/${repo}/issues/${number}`);
warning(ensureError(error));
}
};
Expand Down
Loading

0 comments on commit 8882d68

Please sign in to comment.