Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: default github-token to github.token #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This is a fork of `hmarr/auto-approve-action`.

Automatically approve GitHub pull requests. The `GITHUB_TOKEN` secret must be provided as the `github-token` input for the action to work.
Automatically approve GitHub pull requests.

## Usage instructions

Expand All @@ -24,8 +24,6 @@ jobs:
- name: Auto approve
uses: cognitedata/[email protected]
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

## Why?
Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ branding:
color: 'green'
inputs:
github-token:
default: ${{ github.token }}
description: 'The GITHUB_TOKEN secret'
required: true
required: false
runs:
using: 'node12'
main: 'dist/index.js'
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ function remove_dependabot_approvals(client, pr) {
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const token = core.getInput('github-token', { required: true });
const token = core.getInput('github-token');
const { pull_request: pr } = github.context.payload;
if (!pr) {
throw new Error('Event payload missing `pull_request`');
Expand Down Expand Up @@ -25530,4 +25530,4 @@ module.exports = options => {

/***/ })

/******/ });
/******/ });
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function remove_dependabot_approvals(client: any, pr: any) {

async function run() {
try {
const token = core.getInput('github-token', { required: true });
const token = core.getInput('github-token');

const { pull_request: pr } = github.context.payload;
if (!pr) {
Expand Down