diff --git a/.editorconfig b/.editorconfig deleted file mode 100755 index 7e3649ac..00000000 --- a/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false - -[Makefile] -indent_style = tab diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e4b62e66..00000000 --- a/.eslintrc +++ /dev/null @@ -1,48 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "eslint-comments", - "import", - "prettier", - "promise" - ], - "extends": [ - "airbnb-base", - "eslint:recommended", - "prettier", - "plugin:@typescript-eslint/recommended", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:promise/recommended", - "plugin:prettier/recommended" - ], - "env": { - "es6": true, - "node": true, - "commonjs": true - }, - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module", - "requireConfigFile": false - }, - "rules": { - "no-shadow": 0, - "no-nested-ternary": 0, - "import/extensions": 0, - "consistent-return": 0, - "import/no-unresolved": 0, - "import/prefer-default-export": 0, - "no-param-reassign": [2, { "props": false }], - "func-names": [1, "never", { "generators": "as-needed" }], - "@typescript-eslint/no-namespace": 0, - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/explicit-module-boundary-types": 0, - "@typescript-eslint/no-non-null-assertion": 0, - "no-use-before-define": 0, - "@typescript-eslint/no-use-before-define": 0, - "no-inner-declarations": 0, - "@typescript-eslint/no-inner-declarations": 0 - } -} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f9d38a4e..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Release -on: - push: - branches: - - master -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: bubkoo/release-github-action@v1 - if: ${{ !env.ACT }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f78e5080..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Test - -on: - schedule: - - cron: '45 17 * * 5' - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: 🚧 Install - run: | - yarn - - name: 📦 Build - run: | - yarn build - - uses: ./ - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4d1cd78c..00000000 --- a/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -node_modules -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -coverage -*.lcov -.nyc_output -.npm -.env -.env.test -.cache -.DS_Store -lib -dist diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 6de9a761..00000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -dist/ -lib/ -node_modules/ diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0ddbfd03..00000000 --- a/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 80, - "trailingComma": "all", - "proseWrap": "never", - "overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }] -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 73ede120..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 问崖 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 00fd7114..00000000 --- a/README.md +++ /dev/null @@ -1,120 +0,0 @@ -
Generates a periodic automated summary of activities and happening on your Github repository.
- - - -On running the action, it curates together the following data and publishes it as an issue: - -- Issues - - Open Issues - - Closed Issues - - Hot Issue - - Liked Issue -- Pull requests - - Opened Pull Requests - - Updated Pull Requests - - Merged Pull Requests -- Commits made in the master branch -- Contributors -- Stargazers -- Releases - -## Usage - -Create a `.github/workflows/weekly-report.yml` file in the repository you want to install this action: - -```yml -name: Weekly Report -on: - schedule: - - cron: '0 6 * * 0' # At 06:00 on Sunday -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: bubkoo/activity-report@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -``` - -**It can only run on a `schedule` event.** This schedule uses a cron notation for fine-grained configuration. You can use the following cron notations. Also you can goto [https://crontab.guru](https://crontab.guru/) to design your cron notation which translating the cron schedule into human-readable format. - -- Daily - `0 8 * * *` At 08:00. -- Weekly - `0 8 * * 0` At 08:00 on Sunday. -- Monthly - `0 8 1 * *` At 08:00 on day-of-month 1. -- Quarterly - `0 8 1 1/3 *` At 08:00 on day-of-month 1 in every 3rd month from January through December. -- Half-Yearly - `0 8 1 1/6 *` At 08:00 on day-of-month 1 in every 6th month from January through December. -- Yearly - `0 8 1 1 *` At 08:00 on day-of-month 1 in January. - -We will auto detect your report type (`Daily`, `Weekly`, `Monthly`, `Quarterly`, `Half-Yearly` or `Yearly`) by the cron notation and replace the timing keywords in the issue(title and body). e.g. `"Weekly Report (23 March, 2021 - 30 March, 2021)"`. Other undetectable crons will fallback to use the inexact timing keywords. e.g. `"Activity Report (25 March, 2021 - 30 March, 2021)"`. - -## Inputs - -- `GITHUB_TOKEN`: Your GitHub token for authentication. -- `publish_issues`: Should publish issues or not. Default `true`. -- `publish_top_liked_issues`: Should publish top liked issues with most positive reactions or not, or the count of top liked issues to publish. Default `3`. -- `publish_top_hot_issues`: Should publish top hot issues with most comments or not, or the count of top hot issues to publish. Default `3`. -- `publish_pull_requests`: Should publish pull requests or not. Default `true`. -- `publish_contributors`: Should publish contributors or not. Default `true`. -- `publish_stargazers`: Should publish stargazers or not. Default `true`. -- `publish_commits`: Should publish commits or not. Default `true`. -- `publish_releases`: Should publish releases or not. Default `true`. -- `add_labels`: Comma separated labels to be add to the issue create by this action. By default, the action will add a label in the form `"{{ type }}-report"`, such as `weekly-report`, to the issue. -- `auto_close`: Should auto close old reports or not. Default `true`. - -### Custom template the render the issue - -Using these inputs of template to custom your report. The default templates can be found [here](/src/templates.ts). Follow the [`lodash.template`](https://www.npmjs.com/package/lodash.template) [documentation](https://lodash.com/docs#template). - -- template_title -- template_header -- template_footer -- template_issues_title -- template_issues_summary -- template_issues_summary -- template_issues_statistics -- template_open_issues_title -- template_open_issues_item -- template_open_issues_item -- template_closed_issues_title -- template_closed_issues_item -- template_liked_issues_title -- template_liked_issues_item -- template_liked_issues_item -- template_liked_issues_reaction -- template_hot_issues_title -- template_hot_issues_item -- template_pull_requests_title -- template_pull_requests_summary -- template_open_pull_requests_title -- template_open_pull_requests_summary -- template_open_pull_requests_item -- template_updaed_pull_requests_title -- template_updaed_pull_requests_summary -- template_updaed_pull_requests_item -- template_merged_pull_requests_title -- template_merged_pull_requests_summary -- template_merged_pull_requests_item -- template_commits_title -- template_commits_summary -- template_commits_item -- template_contributors_title -- template_contributors_summary -- template_contributors_item -- template_stargazers_title -- template_stargazers_summary -- template_stargazers_item -- template_releases_title -- template_releases_summary -- template_releases_item - -## License - -The scripts and documentation in this project are released under the [MIT License](LICENSE) diff --git a/dist/commits.d.ts b/dist/commits.d.ts new file mode 100644 index 00000000..69d5576f --- /dev/null +++ b/dist/commits.d.ts @@ -0,0 +1,294 @@ +import { Config, Timespan } from './types'; +export declare namespace Commits { + function list(tailDate: string): Promise<{ + url: string; + sha: string; + node_id: string; + html_url: string; + comments_url: string; + commit: { + url: string; + author: { + name?: string | undefined; + email?: string | undefined; + date?: string | undefined; + } | null; + committer: { + name?: string | undefined; + email?: string | undefined; + date?: string | undefined; + } | null; + message: string; + comment_count: number; + tree: { + sha: string; + url: string; + }; + verification?: { + verified: boolean; + reason: string; + payload: string | null; + signature: string | null; + } | undefined; + }; + author: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + committer: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + parents: { + sha: string; + url: string; + html_url?: string | undefined; + }[]; + stats?: { + additions?: number | undefined; + deletions?: number | undefined; + total?: number | undefined; + } | undefined; + files?: { + filename?: string | undefined; + additions?: number | undefined; + deletions?: number | undefined; + changes?: number | undefined; + status?: string | undefined; + raw_url?: string | undefined; + blob_url?: string | undefined; + patch?: string | undefined; + sha?: string | undefined; + contents_url?: string | undefined; + previous_filename?: string | undefined; + }[] | undefined; + }[]>; + function render(commitList: { + url: string; + sha: string; + node_id: string; + html_url: string; + comments_url: string; + commit: { + url: string; + author: { + name?: string | undefined; + email?: string | undefined; + date?: string | undefined; + } | null; + committer: { + name?: string | undefined; + email?: string | undefined; + date?: string | undefined; + } | null; + message: string; + comment_count: number; + tree: { + sha: string; + url: string; + }; + verification?: { + verified: boolean; + reason: string; + payload: string | null; + signature: string | null; + } | undefined; + }; + author: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + committer: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + parents: { + sha: string; + url: string; + html_url?: string | undefined; + }[]; + stats?: { + additions?: number | undefined; + deletions?: number | undefined; + total?: number | undefined; + } | undefined; + files?: { + filename?: string | undefined; + additions?: number | undefined; + deletions?: number | undefined; + changes?: number | undefined; + status?: string | undefined; + raw_url?: string | undefined; + blob_url?: string | undefined; + patch?: string | undefined; + sha?: string | undefined; + contents_url?: string | undefined; + previous_filename?: string | undefined; + }[] | undefined; + }[] | undefined, timespan: Timespan, config: Config): string; + function renderContributors(commits: { + url: string; + sha: string; + node_id: string; + html_url: string; + comments_url: string; + commit: { + url: string; + author: { + name?: string | undefined; + email?: string | undefined; + date?: string | undefined; + } | null; + committer: { + name?: string | undefined; + email?: string | undefined; + date?: string | undefined; + } | null; + message: string; + comment_count: number; + tree: { + sha: string; + url: string; + }; + verification?: { + verified: boolean; + reason: string; + payload: string | null; + signature: string | null; + } | undefined; + }; + author: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + committer: { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string | undefined; + } | null; + parents: { + sha: string; + url: string; + html_url?: string | undefined; + }[]; + stats?: { + additions?: number | undefined; + deletions?: number | undefined; + total?: number | undefined; + } | undefined; + files?: { + filename?: string | undefined; + additions?: number | undefined; + deletions?: number | undefined; + changes?: number | undefined; + status?: string | undefined; + raw_url?: string | undefined; + blob_url?: string | undefined; + patch?: string | undefined; + sha?: string | undefined; + contents_url?: string | undefined; + previous_filename?: string | undefined; + }[] | undefined; + }[] | undefined, timespan: Timespan, config: Config): string; +} diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 00000000..a4e59227 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,8 @@ +const { readFileSync, writeFileSync } = require('fs'), { Script } = require('vm'), { wrap } = require('module'); +const basename = __dirname + '/index.js'; +const source = readFileSync(basename + '.cache.js', 'utf-8'); +const cachedData = !process.pkg && require('process').platform !== 'win32' && readFileSync(basename + '.cache'); +const scriptOpts = { filename: basename + '.cache.js', columnOffset: -62 } +const script = new Script(wrap(source), cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts); +(script.runInThisContext())(exports, require, module, __filename, __dirname); +if (cachedData) process.on('exit', () => { try { writeFileSync(basename + '.cache', script.createCachedData()); } catch(e) {} }); diff --git a/dist/index.js.cache b/dist/index.js.cache new file mode 100644 index 00000000..174144da Binary files /dev/null and b/dist/index.js.cache differ diff --git a/dist/index.js.cache.js b/dist/index.js.cache.js new file mode 100644 index 00000000..914f5ad5 --- /dev/null +++ b/dist/index.js.cache.js @@ -0,0 +1 @@ +module.exports=(()=>{var __webpack_modules__={7351:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=n(r(2087));const o=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const i="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${i}${escapeData(this.message)}`;return e}}function escapeData(e){return o.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return o.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const o=r(7351);const i=r(717);const a=r(5278);const u=s(r(2087));const l=s(r(5622));var c;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(c=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=a.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${u.EOL}${r}${u.EOL}${t}`;i.issueCommand("ENV",n)}else{o.issueCommand("set-env",{name:e},r)}}t.exportVariable=exportVariable;function setSecret(e){o.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){i.issueCommand("PATH",e)}else{o.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${l.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}return r.trim()}t.getInput=getInput;function setOutput(e,t){o.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setCommandEcho(e){o.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=c.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){o.issueCommand("debug",{},e)}t.debug=debug;function error(e){o.issue("error",e instanceof Error?e.toString():e)}t.error=error;function warning(e){o.issue("warning",e instanceof Error?e.toString():e)}t.warning=warning;function info(e){process.stdout.write(e+u.EOL)}t.info=info;function startGroup(e){o.issue("group",e)}t.startGroup=startGroup;function endGroup(){o.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return n(this,void 0,void 0,function*(){startGroup(e);let r;try{r=yield t()}finally{endGroup()}return r})}t.group=group;function saveState(e,t){o.issueCommand("save-state",{name:e},t)}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState},717:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=n(r(5747));const o=n(r(2087));const i=r(5278);function issueCommand(e,t){const r=process.env[`GITHUB_${e}`];if(!r){throw new Error(`Unable to find environment variable for file command ${e}`)}if(!s.existsSync(r)){throw new Error(`Missing file at path: ${r}`)}s.appendFileSync(r,`${i.toCommandValue(t)}${o.EOL}`,{encoding:"utf8"})}t.issueCommand=issueCommand},5278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}t.toCommandValue=toCommandValue},4087:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Context=void 0;const n=r(5747);const s=r(2087);class Context{constructor(){this.payload={};if(process.env.GITHUB_EVENT_PATH){if(n.existsSync(process.env.GITHUB_EVENT_PATH)){this.payload=JSON.parse(n.readFileSync(process.env.GITHUB_EVENT_PATH,{encoding:"utf8"}))}else{const e=process.env.GITHUB_EVENT_PATH;process.stdout.write(`GITHUB_EVENT_PATH ${e} does not exist${s.EOL}`)}}this.eventName=process.env.GITHUB_EVENT_NAME;this.sha=process.env.GITHUB_SHA;this.ref=process.env.GITHUB_REF;this.workflow=process.env.GITHUB_WORKFLOW;this.action=process.env.GITHUB_ACTION;this.actor=process.env.GITHUB_ACTOR;this.job=process.env.GITHUB_JOB;this.runNumber=parseInt(process.env.GITHUB_RUN_NUMBER,10);this.runId=parseInt(process.env.GITHUB_RUN_ID,10)}get issue(){const e=this.payload;return Object.assign(Object.assign({},this.repo),{number:(e.issue||e.pull_request||e).number})}get repo(){if(process.env.GITHUB_REPOSITORY){const[e,t]=process.env.GITHUB_REPOSITORY.split("/");return{owner:e,repo:t}}if(this.payload.repository){return{owner:this.payload.repository.owner.login,repo:this.payload.repository.name}}throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'")}}t.Context=Context},5438:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))n(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.getOctokit=t.context=void 0;const i=o(r(4087));const a=r(3030);t.context=new i.Context;function getOctokit(e,t){return new a.GitHub(a.getOctokitOptions(e,t))}t.getOctokit=getOctokit},7914:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))n(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.getApiBaseUrl=t.getProxyAgent=t.getAuthString=void 0;const i=o(r(9925));function getAuthString(e,t){if(!e&&!t.auth){throw new Error("Parameter token or opts.auth is required")}else if(e&&t.auth){throw new Error("Parameters token and opts.auth may not both be specified")}return typeof t.auth==="string"?t.auth:`token ${e}`}t.getAuthString=getAuthString;function getProxyAgent(e){const t=new i.HttpClient;return t.getAgent(e)}t.getProxyAgent=getProxyAgent;function getApiBaseUrl(){return process.env["GITHUB_API_URL"]||"https://api.github.com"}t.getApiBaseUrl=getApiBaseUrl},3030:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))n(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.getOctokitOptions=t.GitHub=t.context=void 0;const i=o(r(4087));const a=o(r(7914));const u=r(6762);const l=r(3044);const c=r(4193);t.context=new i.Context;const d=a.getApiBaseUrl();const f={baseUrl:d,request:{agent:a.getProxyAgent(d)}};t.GitHub=u.Octokit.plugin(l.restEndpointMethods,c.paginateRest).defaults(f);function getOctokitOptions(e,t){const r=Object.assign({},t||{});const n=a.getAuthString(e,r);if(n){r.auth=n}return r}t.getOctokitOptions=getOctokitOptions},9925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(8605);const s=r(7211);const o=r(6443);let i;var a;(function(e){e[e["OK"]=200]="OK";e[e["MultipleChoices"]=300]="MultipleChoices";e[e["MovedPermanently"]=301]="MovedPermanently";e[e["ResourceMoved"]=302]="ResourceMoved";e[e["SeeOther"]=303]="SeeOther";e[e["NotModified"]=304]="NotModified";e[e["UseProxy"]=305]="UseProxy";e[e["SwitchProxy"]=306]="SwitchProxy";e[e["TemporaryRedirect"]=307]="TemporaryRedirect";e[e["PermanentRedirect"]=308]="PermanentRedirect";e[e["BadRequest"]=400]="BadRequest";e[e["Unauthorized"]=401]="Unauthorized";e[e["PaymentRequired"]=402]="PaymentRequired";e[e["Forbidden"]=403]="Forbidden";e[e["NotFound"]=404]="NotFound";e[e["MethodNotAllowed"]=405]="MethodNotAllowed";e[e["NotAcceptable"]=406]="NotAcceptable";e[e["ProxyAuthenticationRequired"]=407]="ProxyAuthenticationRequired";e[e["RequestTimeout"]=408]="RequestTimeout";e[e["Conflict"]=409]="Conflict";e[e["Gone"]=410]="Gone";e[e["TooManyRequests"]=429]="TooManyRequests";e[e["InternalServerError"]=500]="InternalServerError";e[e["NotImplemented"]=501]="NotImplemented";e[e["BadGateway"]=502]="BadGateway";e[e["ServiceUnavailable"]=503]="ServiceUnavailable";e[e["GatewayTimeout"]=504]="GatewayTimeout"})(a=t.HttpCodes||(t.HttpCodes={}));var u;(function(e){e["Accept"]="accept";e["ContentType"]="content-type"})(u=t.Headers||(t.Headers={}));var l;(function(e){e["ApplicationJson"]="application/json"})(l=t.MediaTypes||(t.MediaTypes={}));function getProxyUrl(e){let t=o.getProxyUrl(new URL(e));return t?t.href:""}t.getProxyUrl=getProxyUrl;const c=[a.MovedPermanently,a.ResourceMoved,a.SeeOther,a.TemporaryRedirect,a.PermanentRedirect];const d=[a.BadGateway,a.ServiceUnavailable,a.GatewayTimeout];const f=["OPTIONS","GET","DELETE","HEAD"];const p=10;const h=5;class HttpClientError extends Error{constructor(e,t){super(e);this.name="HttpClientError";this.statusCode=t;Object.setPrototypeOf(this,HttpClientError.prototype)}}t.HttpClientError=HttpClientError;class HttpClientResponse{constructor(e){this.message=e}readBody(){return new Promise(async(e,t)=>{let r=Buffer.alloc(0);this.message.on("data",e=>{r=Buffer.concat([r,e])});this.message.on("end",()=>{e(r.toString())})})}}t.HttpClientResponse=HttpClientResponse;function isHttps(e){let t=new URL(e);return t.protocol==="https:"}t.isHttps=isHttps;class HttpClient{constructor(e,t,r){this._ignoreSslError=false;this._allowRedirects=true;this._allowRedirectDowngrade=false;this._maxRedirects=50;this._allowRetries=false;this._maxRetries=1;this._keepAlive=false;this._disposed=false;this.userAgent=e;this.handlers=t||[];this.requestOptions=r;if(r){if(r.ignoreSslError!=null){this._ignoreSslError=r.ignoreSslError}this._socketTimeout=r.socketTimeout;if(r.allowRedirects!=null){this._allowRedirects=r.allowRedirects}if(r.allowRedirectDowngrade!=null){this._allowRedirectDowngrade=r.allowRedirectDowngrade}if(r.maxRedirects!=null){this._maxRedirects=Math.max(r.maxRedirects,0)}if(r.keepAlive!=null){this._keepAlive=r.keepAlive}if(r.allowRetries!=null){this._allowRetries=r.allowRetries}if(r.maxRetries!=null){this._maxRetries=r.maxRetries}}}options(e,t){return this.request("OPTIONS",e,null,t||{})}get(e,t){return this.request("GET",e,null,t||{})}del(e,t){return this.request("DELETE",e,null,t||{})}post(e,t,r){return this.request("POST",e,t,r||{})}patch(e,t,r){return this.request("PATCH",e,t,r||{})}put(e,t,r){return this.request("PUT",e,t,r||{})}head(e,t){return this.request("HEAD",e,null,t||{})}sendStream(e,t,r,n){return this.request(e,t,r,n)}async getJson(e,t={}){t[u.Accept]=this._getExistingOrDefaultHeader(t,u.Accept,l.ApplicationJson);let r=await this.get(e,t);return this._processResponse(r,this.requestOptions)}async postJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[u.Accept]=this._getExistingOrDefaultHeader(r,u.Accept,l.ApplicationJson);r[u.ContentType]=this._getExistingOrDefaultHeader(r,u.ContentType,l.ApplicationJson);let s=await this.post(e,n,r);return this._processResponse(s,this.requestOptions)}async putJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[u.Accept]=this._getExistingOrDefaultHeader(r,u.Accept,l.ApplicationJson);r[u.ContentType]=this._getExistingOrDefaultHeader(r,u.ContentType,l.ApplicationJson);let s=await this.put(e,n,r);return this._processResponse(s,this.requestOptions)}async patchJson(e,t,r={}){let n=JSON.stringify(t,null,2);r[u.Accept]=this._getExistingOrDefaultHeader(r,u.Accept,l.ApplicationJson);r[u.ContentType]=this._getExistingOrDefaultHeader(r,u.ContentType,l.ApplicationJson);let s=await this.patch(e,n,r);return this._processResponse(s,this.requestOptions)}async request(e,t,r,n){if(this._disposed){throw new Error("Client has already been disposed.")}let s=new URL(t);let o=this._prepareRequest(e,s,n);let i=this._allowRetries&&f.indexOf(e)!=-1?this._maxRetries+1:1;let u=0;let l;while(u0){const i=l.message.headers["location"];if(!i){break}let a=new URL(i);if(s.protocol=="https:"&&s.protocol!=a.protocol&&!this._allowRedirectDowngrade){throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.")}await l.readBody();if(a.hostname!==s.hostname){for(let e in n){if(e.toLowerCase()==="authorization"){delete n[e]}}}o=this._prepareRequest(e,a,n);l=await this.requestRaw(o,r);t--}if(d.indexOf(l.message.statusCode)==-1){return l}u+=1;if(u{let s=function(e,t){if(e){n(e)}r(t)};this.requestRawWithCallback(e,t,s)})}requestRawWithCallback(e,t,r){let n;if(typeof t==="string"){e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8")}let s=false;let o=(e,t)=>{if(!s){s=true;r(e,t)}};let i=e.httpModule.request(e.options,e=>{let t=new HttpClientResponse(e);o(null,t)});i.on("socket",e=>{n=e});i.setTimeout(this._socketTimeout||3*6e4,()=>{if(n){n.end()}o(new Error("Request timeout: "+e.options.path),null)});i.on("error",function(e){o(e,null)});if(t&&typeof t==="string"){i.write(t,"utf8")}if(t&&typeof t!=="string"){t.on("close",function(){i.end()});t.pipe(i)}else{i.end()}}getAgent(e){let t=new URL(e);return this._getAgent(t)}_prepareRequest(e,t,r){const o={};o.parsedUrl=t;const i=o.parsedUrl.protocol==="https:";o.httpModule=i?s:n;const a=i?443:80;o.options={};o.options.host=o.parsedUrl.hostname;o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):a;o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||"");o.options.method=e;o.options.headers=this._mergeHeaders(r);if(this.userAgent!=null){o.options.headers["user-agent"]=this.userAgent}o.options.agent=this._getAgent(o.parsedUrl);if(this.handlers){this.handlers.forEach(e=>{e.prepareRequest(o.options)})}return o}_mergeHeaders(e){const t=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});if(this.requestOptions&&this.requestOptions.headers){return Object.assign({},t(this.requestOptions.headers),t(e))}return t(e||{})}_getExistingOrDefaultHeader(e,t,r){const n=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{});let s;if(this.requestOptions&&this.requestOptions.headers){s=n(this.requestOptions.headers)[t]}return e[t]||s||r}_getAgent(e){let t;let a=o.getProxyUrl(e);let u=a&&a.hostname;if(this._keepAlive&&u){t=this._proxyAgent}if(this._keepAlive&&!u){t=this._agent}if(!!t){return t}const l=e.protocol==="https:";let c=100;if(!!this.requestOptions){c=this.requestOptions.maxSockets||n.globalAgent.maxSockets}if(u){if(!i){i=r(4294)}const e={maxSockets:c,keepAlive:this._keepAlive,proxy:{...(a.username||a.password)&&{proxyAuth:`${a.username}:${a.password}`},host:a.hostname,port:a.port}};let n;const s=a.protocol==="https:";if(l){n=s?i.httpsOverHttps:i.httpsOverHttp}else{n=s?i.httpOverHttps:i.httpOverHttp}t=n(e);this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:c};t=l?new s.Agent(e):new n.Agent(e);this._agent=t}if(!t){t=l?s.globalAgent:n.globalAgent}if(l&&this._ignoreSslError){t.options=Object.assign(t.options||{},{rejectUnauthorized:false})}return t}_performExponentialBackoff(e){e=Math.min(p,e);const t=h*Math.pow(2,e);return new Promise(e=>setTimeout(()=>e(),t))}static dateTimeDeserializer(e,t){if(typeof t==="string"){let e=new Date(t);if(!isNaN(e.valueOf())){return e}}return t}async _processResponse(e,t){return new Promise(async(r,n)=>{const s=e.message.statusCode;const o={statusCode:s,result:null,headers:{}};if(s==a.NotFound){r(o)}let i;let u;try{u=await e.readBody();if(u&&u.length>0){if(t&&t.deserializeDates){i=JSON.parse(u,HttpClient.dateTimeDeserializer)}else{i=JSON.parse(u)}o.result=i}o.headers=e.message.headers}catch(e){}if(s>299){let e;if(i&&i.message){e=i.message}else if(u&&u.length>0){e=u}else{e="Failed request: ("+s+")"}let t=new HttpClientError(e,s);t.result=o.result;n(t)}else{r(o)}})}}t.HttpClient=HttpClient},6443:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function getProxyUrl(e){let t=e.protocol==="https:";let r;if(checkBypass(e)){return r}let n;if(t){n=process.env["https_proxy"]||process.env["HTTPS_PROXY"]}else{n=process.env["http_proxy"]||process.env["HTTP_PROXY"]}if(n){r=new URL(n)}return r}t.getProxyUrl=getProxyUrl;function checkBypass(e){if(!e.hostname){return false}let t=process.env["no_proxy"]||process.env["NO_PROXY"]||"";if(!t){return false}let r;if(e.port){r=Number(e.port)}else if(e.protocol==="http:"){r=80}else if(e.protocol==="https:"){r=443}let n=[e.hostname.toUpperCase()];if(typeof r==="number"){n.push(`${n[0]}:${r}`)}for(let e of t.split(",").map(e=>e.trim().toUpperCase()).filter(e=>e)){if(n.some(t=>t===e)){return true}}return false}t.checkBypass=checkBypass},334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});async function auth(e){const t=e.split(/\./).length===3?"app":/^v\d+\./.test(e)?"installation":"oauth";return{type:"token",token:e,tokenType:t}}function withAuthorizationPrefix(e){if(e.split(/\./).length===3){return`bearer ${e}`}return`token ${e}`}async function hook(e,t,r,n){const s=t.endpoint.merge(r,n);s.headers.authorization=withAuthorizationPrefix(e);return t(s)}const r=function createTokenAuth(e){if(!e){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof e!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}e=e.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,e),{hook:hook.bind(null,e)})};t.createTokenAuth=r},6762:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(5030);var s=r(3682);var o=r(6234);var i=r(8467);var a=r(334);function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var s,o;for(o=0;o