Skip to content

Commit

Permalink
Merge pull request #44 from alex-page/master
Browse files Browse the repository at this point in the history
v0.0.4 - Upgrade dependencies
  • Loading branch information
AndrewMusgrave authored May 10, 2021
2 parents 1639965 + e2a515a commit ebb189e
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 141 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

---

## 0.0.4 - 2021-05-07

- Update dependencies

## 0.0.3 - 2021-05-06

- Add `repo-token` to actions.yml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- name: Approve pull request
if: github.actor == 'dependabot[bot]'
uses: andrewmusgrave/[email protected].3
uses: andrewmusgrave/[email protected].4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
event: APPROVE
Expand Down
8 changes: 7 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import core from '@actions/core';
import github from '@actions/github';

const token = core.getInput('repo-token');
const requestEvent = core.getInput('event');
const body = core.getInput('body');

const octokit = new github.GitHub(token);
const octokit = github.getOctokit(token)

if (
(requestEvent === 'COMMENT' || requestEvent === 'REQUEST_CHANGES') &&
Expand All @@ -20,17 +20,16 @@ if (!pullRequest) {
core.setFailed('This action is meant to be ran on pull requests');
}

octokit
.graphql(
`
mutation {
addPullRequestReview(input: {
pullRequestId: "${(<any>pullRequest)['node_id']}",
event: ${requestEvent},
body: "${body}"
}) {clientMutationId} }`,
)
.catch((err) => {
core.error(err);
core.setFailed(err.message);
});
const query = `
mutation {
addPullRequestReview(input: {
pullRequestId: "${(<any>pullRequest)['node_id']}",
event: ${requestEvent},
body: "${body}"
}) {clientMutationId}
}`;

octokit.graphql(query).catch((err) => {
core.error(err);
core.setFailed(err.message);
});
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "automatic-pull-request-review",
"version": "0.0.3",
"version": "0.0.4",
"description": "👍 Github action to automate pull requests",
"private": true,
"main": "dist/index.js",
Expand All @@ -24,13 +24,14 @@
},
"homepage": "https://github.com/andrewmusgrave/automatic-pull-request-review#readme",
"dependencies": {
"@actions/core": "^1.0.0",
"@actions/github": "^1.0.0"
"@actions/core": "^1.2.7",
"@actions/github": "^4.0.0"
},
"devDependencies": {
"@types/node": "^12.7.4",
"@zeit/ncc": "^0.20.4",
"husky": "^3.0.5"
"@vercel/ncc": "^0.28.5",
"husky": "^3.0.5",
"typescript": "^4.2.4"
},
"files": [
"dist/index.js"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"rootDir": "." /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"moduleResolution": "node"
},
"exclude": ["node_modules"]
}
Loading

0 comments on commit ebb189e

Please sign in to comment.