ahmadnassri / action-dependabot-auto-merge

Automatically merge Dependabot PRs when version comparison is within range
MIT License
342 stars 48 forks source link

Auto Merge Not Working #47

Closed donavanbecker closed 3 years ago

donavanbecker commented 3 years ago

The Full Run Workflow File

2020-12-31T18:18:58.0614594Z /action/node_modules/@actions/core/lib/core.js:94
2020-12-31T18:18:58.0615873Z         throw new Error(`Input required and not supplied: ${name}`);
2020-12-31T18:18:58.0616603Z               ^
2020-12-31T18:18:58.0617075Z 
2020-12-31T18:18:58.0618377Z Error: Input required and not supplied: github-token
2020-12-31T18:18:58.0619494Z     at Object.getInput (/action/node_modules/@actions/core/lib/core.js:94:15)
2020-12-31T18:18:58.0620346Z     at file:///action/index.js:28:15
2020-12-31T18:18:58.0621151Z     at ModuleJob.run (node:internal/modules/esm/module_job:152:23)
2020-12-31T18:18:58.0622009Z     at async Loader.import (node:internal/modules/esm/loader:166:24)
2020-12-31T18:18:58.0623624Z     at async Object.loadESM (node:internal/process/esm_loader:68:5)
ahmadnassri commented 3 years ago

I'll take a look to investigate next year (Monday 😄)

happy new year!

slinkardbrandon commented 3 years ago

I just ran into this same error 😞

This is how I configured the auto-merge action:

name: auto-merge

on:
  pull_request:

jobs:
  auto-merge:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: ahmadnassri/action-dependabot-auto-merge@v2
        with:
          target: minor
          github-token: ${{ secrets.mytoken }}
artekr commented 3 years ago

This is probably the github-token is not set properly, you might want to change it to your own secret. According to the doc

GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in a workflow run.

So you can simple put

github-token: ${{ secrets.GITHUB_TOKEN }}
donavanbecker commented 3 years ago

This is probably the github-token is not set properly, you might want to change it to your own secret. According to the doc

GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in a workflow run.

So you can simple put

github-token: ${{ secrets.GITHUB_TOKEN }}

I did that and it still didn't work.

ahmadnassri commented 3 years ago

@donavanbecker the default provided secrets.GITHUB_TOKEN is not sufficient, I did see that you had used different tokens in previous commits ... but perhaps the scope wasn't correctly set?

see the README on the requried scope: https://github.com/ahmadnassri/action-dependabot-auto-merge#token-scope

that said, the error is from the @actions/core library and it's not seeing any value assigned to github-token so the secret is not even passed to the action ... is this a repo secret? or an org secret?