Giter VIP home page Giter VIP logo

Comments (5)

MolotovCherry avatar MolotovCherry commented on June 19, 2024 1

I see. For some reason I thought that the token works when it's left already generated in your account. Forgot you also need to paste it into the repo token area too before it will be seen

Thanks for the pointer. Your link gave me the thought that got me to consider that.

Thanks for your useful Github actions again! They've made my life MUCH easier. 💯

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

Hi @cherryleafroad

It might be due to how the workflow is being triggered. Workflows triggered by a pull request from a fork don't have access to secrets. In that case the secret will be empty and result in the error you are seeing. There is some info about this here:
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#restrictions-on-repository-forks

If that doesn't explain your issue let me know.

from enable-pull-request-automerge.

MolotovCherry avatar MolotovCherry commented on June 19, 2024

That's the strange thing in fact; it's an ordinary push workflow which is definitely triggered on push.

on:
  push:
    branches: [ main ]
  workflow_dispatch:

That's an idea though, I'll check to see if the secret coming in is empty or not

Edit: You seem to be right. I did an echo ${{ secret.PAT }} and it shows nothing.
Edit2: I'm not using on: pull_request, but perhaps they changed the restriction. As your post said, I am indeed on a fork.
Edi3: Deleted the repo and am not on a fork anymore. Secret is still empty :/

This is most probably the problem. Seems to be an edge case I didn't anticipate (and wasn't listed in the docs yet). I'll recreate my repo without forking then

My workflow is here, although it's fairly simple and I doubt there's anything unusual about it

(For the parts you can't see, I know for certain the secret is correct and works since I'm using it in my other repos; Auto merge is already enabled, as is Automatically delete head branches and the branch protection rule for requiring approval)

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

I think REPO_SCOPED_TOKEN is empty. If there was content GitHub normally shows asterisks *** to mask the secret.

image

  • Check that REPO_SCOPED_TOKEN is the exact name for the secret in the repository secrets.
  • Copy/paste the PAT into the secret again, just in case.

from enable-pull-request-automerge.

WeihanLi avatar WeihanLi commented on June 19, 2024

Got the same error This endpoint requires you to be authenticated
Github action run: https://github.com/WeihanLi/SparkTodo/runs/7374464887?check_suite_focus=true
-- edited
My bad, the token is not set for the workflow, sorry for the inconvinience

from enable-pull-request-automerge.

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.