diff --git a/action.yml b/action.yml index 9451f3d..457fd6c 100644 --- a/action.yml +++ b/action.yml @@ -2,13 +2,15 @@ name: 'PR from test to master' description: 'Check if test is behind master, if so create a branch capturing the state of test and open a PR to master from it' author: 'iFit' inputs: + github-api-token: + description: 'get this from 1password' repository-name: description: 'the name of the repository this the PR will be created for' pr-reviewers: description: 'Comma seperated list of github user ids who will review the PR' default: '' pr-team-reviewers: - description: 'Comma seperated list of github teams whoe will review the PR' + description: 'Comma seperated list of github teams who will review the PR' default: '' runs: using: 'node12' diff --git a/dist/index.js b/dist/index.js index 5f32c50..3410ead 100644 --- a/dist/index.js +++ b/dist/index.js @@ -345,10 +345,10 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -// import * as request from 'request-promise-native'; const core = __importStar(__webpack_require__(470)); // API Docs: https://developer.github.com/v3 -const { GITHUB_API_TOKEN } = process.env; +// const { GITHUB_API_TOKEN } = process.env; +const GITHUB_API_TOKEN = core.getInput('github-api-token'); const repositoryName = core.getInput('repository-name'); const prReviewers = core.getInput('pr-reviewers'); const prTeamReviewers = core.getInput('pr-team-reviewers'); diff --git a/src/pr-to-master.ts b/src/pr-to-master.ts index 7facc69..7326adc 100644 --- a/src/pr-to-master.ts +++ b/src/pr-to-master.ts @@ -1,14 +1,14 @@ -// import * as request from 'request-promise-native'; +import * as request from 'request-promise-native'; import * as core from '@actions/core'; // API Docs: https://developer.github.com/v3 -const { GITHUB_API_TOKEN } = process.env; - +// const { GITHUB_API_TOKEN } = process.env; +const GITHUB_API_TOKEN = core.getInput('github-api-token'); const repositoryName = core.getInput('repository-name'); const prReviewers = core.getInput('pr-reviewers'); const prTeamReviewers = core.getInput('pr-team-reviewers'); -console.log({ GITHUB_API_TOKEN: Boolean(GITHUB_API_TOKEN), repositoryName, prReviewers, prTeamReviewers}) +console.log({ GITHUB_API_TOKEN: Boolean(GITHUB_API_TOKEN), repositoryName, prReviewers, prTeamReviewers }) // const REPO = `https://api.github.com/repos/ifit/${repositoryName}`; // const defaults = {