Git Product home page Git Product logo

Comments (5)

ahmadnassri avatar ahmadnassri commented on June 7, 2024

can you share your github action workflow in which you added this action in? most likely it's being triggered on multiple events ..

from action-dependabot-auto-merge.

pipedreambomb avatar pipedreambomb commented on June 7, 2024

I don't know, it's in a private repository, can I share that? If you just want the file, it looks like this:

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - uses: ahmadnassri/action-dependabot-auto-merge@v2
        with:
          github-token: ${{ secrets.DEPENDABOT_AUTO_MERGE }}

Also, the latest build that ran automatically in response to a new Dependabot PR has a different error message:

/action/node_modules/@actions/core/lib/core.js:94
        throw new Error(`Input required and not supplied: ${name}`);
              ^

Error: Input required and not supplied: github-token
    at Object.getInput (/action/node_modules/@actions/core/lib/core.js:94:15)
    at file:///action/index.js:28:15
    at ModuleJob.run (node:internal/modules/esm/module_job:154:23)
    at async Loader.import (node:internal/modules/esm/loader:166:24)
    at async Object.loadESM (node:internal/process/esm_loader:68:5)

from action-dependabot-auto-merge.

ahmadnassri avatar ahmadnassri commented on June 7, 2024

the file itself shared here is good enough to indicate what the issue is

  1. you have a workflow that runs on both push and pull_request this action is meant to turn on PRs from dependabot, so the push event is an extra trigger and it errors out to prevent any issues as it's not supposed to be used with push.
  2. recently github made a security change, where pull_request events no longer have access to secrets, hence the new error you're seeing. please read this issue #60 CAREFULLY and switch to using pull_request_target instead.

again: READ CAREFULLY as switching to pull_request_target has security implications you should be aware of.

in the meantime, I'm working on a whole refactor that would make this cleaner and easier, so keep an eye out for future updates.

from action-dependabot-auto-merge.

pipedreambomb avatar pipedreambomb commented on June 7, 2024

OK thanks very much. This was my first time with GitHub Actions, so I didn't realise I was supposed to change the triggers myself!

I think maybe auto-merging Dependabot PRs for this project might be a bad idea after all, thanks to some weird issue I just had with Expo seeming to expect certain packages. I think I'll go back to manually approving.

from action-dependabot-auto-merge.

ahmadnassri avatar ahmadnassri commented on June 7, 2024

no worries, glad I could help.

from action-dependabot-auto-merge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.