Git Product home page Git Product logo

Comments (3)

negz avatar negz commented on August 26, 2024 1

Please let me know if you're still interested in this feature knowing this.

I am. I don't disagree that the PAT approach is likely better, but I'm using this action quite extensively across two orgs and many repos, so being able to turn on a prompt to close and reopen the PR is a more compelling short-term fix than going through and figuring out setting up a bot account, PAT, etc etc across both orgs. Especially considering the potential security implications.

from backport-action.

korthout avatar korthout commented on August 26, 2024

Hi @negz, that sounds like a good addition. I can imagine other use cases for this as well. But, allow me first to focus on your case.

One hacky but very lightweight workaround for this issue

In your case, it's probably better to look at the 2nd option from this workaround section:

Use a repo scoped Personal Access Token (PAT) created on an account that has write access to the repository that pull requests are being created in. This is the standard workaround and recommended by GitHub. However, the PAT cannot be scoped to a specific repository so the token becomes a very sensitive secret. If this is a concern, the PAT can instead be created for a dedicated machine account that has collaborator access to the repository. Also note that because the account that owns the PAT will be the creator of pull requests, that user account will be unable to perform actions such as request changes or approve the pull request.

If you change the github_token input value to the PAT of a machine account that is contributor in your repo, the backport-action should simply interact with your repository from that machine account. This should then trigger your workflows normally.

Please let me know if you're still interested in this feature knowing this. If you happen to try the above solution, please also let me know if you run into any issues.


Having said that, I see 2 options to support more dynamic PR descriptions:

  • allow configuring a template for the PR description
    • this requires some input property, e.g. pr_description_template
    • this requires special keywords that when used in the template are replaced with:
      • the original pr_number
      • the target branchname
  • allow configuring a footer/postfix for the PR description
    • this requires some input property, e.g. pr_description_footer
    • just appends the value to the PR description

Clearly the latter is easier to implement, but the prior seems more flexible and extendable in the future. My preference would go to the prior. I'm also open to other ideas.

from backport-action.

korthout avatar korthout commented on August 26, 2024

@negz I've created a pull request to add support for this, using the first option I described. Note that the naming has changed from that first proposal. For the full documentation, please have a look at the README.

You can use the version of this pull request by configuring the action in your workflow:

   ...
   uses: zeebe-io/backport-action@custom-pull-descriptions
   with:
     version: custom-pull-descriptions
     pull_description: |-
       Your custom description here,
       It can contain new lines and ${placeholders}
       See the README linked above for more details

Please let me know whether this works correctly for you 🙂

from backport-action.

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.