Code Monkey home page Code Monkey logo

Comments (6)

peter-evans avatar peter-evans commented on August 20, 2024

Thank you for raising this issue. I would really like to understand your use-case here and try and reproduce the problem. If you could provide more detail that would be great. e.g. (create-pull-request version, your entire workflow, your use-case, etc.) If it's in open source a link to the repository would be even better.

Just trying to guess based on the error message you provided. Are you trying to modify a workflow file during the execution of a workflow? There are definitely restrictions with this. You mentioned that the first run failed. What was the error message then?

If you try and modify workflow files and push them during the execution of a workflow you might see an error message like this:

git.exc.GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git push -f --set-upstream origin test-patches
  stderr: 'To https://github.com/peter-evans/actions-playground
 ! [remote rejected] test-patches -> test-patches (refusing to allow an integration to create or update .github/workflows/create-pull-request.yml)

To get to the bottom of this issue I think we need to focus on the use-case you have and the error thrown the first time the action ran.

from create-pull-request.

thieman avatar thieman commented on August 20, 2024

I think this is what happened:

  1. I ran the action from a dummy, non-master branch. This opened a PR against the non-master branch (intended behavior, though I didn't realize this at the time)
  2. I then deleted the dummy branch since I was just pushing to it to trigger an action build and it did not have any actual changes in it
  3. GitHub automatically closed the PRs before I even saw them, since they were based on a now-deleted branch

So what I observed was "there are no PRs, and running the action again doesn't make PRs" but in reality I think everything did what it should have done.

I think what I wanted to do was pass PULL_REQUEST_BASE=master in step 1 so that the PR got opened against master, not my dummy branch.

I think the only change I might ask for from this issue would be for the action to be a bit more verbose in logging what's going on. I threw a bunch of print statements in my fork of the action which is what helped me track down what happened.

I'll close this issue, thanks!

from create-pull-request.

peter-evans avatar peter-evans commented on August 20, 2024

Glad you figured it out. You're right, the logging could be much better. I will look into adding some more verbose and understandable messages.

from create-pull-request.

danopia avatar danopia commented on August 20, 2024

I ran into another case where this error message seemed wrong, in my case because there was already a PR open from a previous run which (sensibly) made the same change. I eventually realized this message was telling me that, based on the existing PR there were no new changes to commit. Perhaps in this case a message more like Repository has no modified or untracked files compared to existing PR. Skipping. would be more clear.

from create-pull-request.

peter-evans avatar peter-evans commented on August 20, 2024

Thanks @danopia. You're right, it's not clear what the action is doing in that case. I'm working on adding clearer messages and detail about what the action is doing for the next release.

from create-pull-request.

peter-evans avatar peter-evans commented on August 20, 2024

Released a new version of the action today that has much clearer messages about what the action is doing.

from create-pull-request.

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.