Skip to content

Commit

Permalink
feat: Add api token as input
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-archer committed Nov 8, 2019
1 parent 082c442 commit fb90e22
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions src/pr-to-master.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down

0 comments on commit fb90e22

Please sign in to comment.