squalrus / merge-bot

A GitHub action that manages pull request integrations
MIT License
71 stars 12 forks source link

GITHUB_TOKEN is unknown as a parameter #30

Closed orj closed 4 years ago

orj commented 4 years ago

When running the action it outputs:

##[warning]Unexpected input 'GITHUB_TOKEN', valid inputs are ['test', 'labels', 'blocking-labels', 'reviewers', 'checks_enabled', 'method']

To Reproduce Configure the action workflow:

name: Merge Bot

on:
  pull_request:
    types: [labeled, unlabeled, ready_for_review, review_request_removed, review_requested, synchronize]
  pull_request_review:
    types: [dismissed, submitted]

jobs:
  merge:
    runs-on: ubuntu-latest
    name: Merge
    steps:
    - name: Integration check
      uses: squalrus/merge-bot@v0.4.1
      with:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        test: true
        reviewers: true
        labels: "pr:merge-on-approval"        
        checks_enabled: true
        method: merge

Expected behavior That it not spit out warnings. I think you should change

        const token = core.getInput('GITHUB_TOKEN');

to:

        const token = process.env['GITHUB_TOKEN'] || '';

And change your configuration example to:

      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        test: true
        reviewers: true

etc.

squalrus commented 4 years ago

Thank you for identifying this. I beleive this is resolved in the latest release (0.4.2) by adding GITHUB_TOKEN to action.yml as required input.

I opted for this based on the documentation for Example passing GITHUB_TOKEN as an input.

Let me know if you have further issues.