Git Product home page Git Product logo

create-other-repo-branch-action's Introduction

create-other-repo-branch-action's People

Contributors

guillaumefalourd avatar lens0021 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

create-other-repo-branch-action's Issues

Doesn't clean submodules before creating branch

Currently, when the action is checked out, it checks out from the base directory which may include sub modules that are not in the new_branch_ref branch and it does not clean that history. This creates issues onwards.

Feature: Allow use of deploy keys

Hey again ๐Ÿ‘‹

I've really been enjoying your github action and have used it in combination with other actions.

One requirement that I currently have is I need to use SSH deploy keys instead of PAT.

I have an implementation that I tested on a dummy repo which is working fine.
Here are some links to those dummy repos:

You can find my implementation here:
https://github.com/ddymko/create-other-repo-branch-action/blob/ssh-keys-deploy/action.yml#L31

I changed the conditional logic for cloning a bit. The flow is as

  • If access_token and ssh_deploy_key are defined: error
  • if access_token is set: clone with access token
  • if ssh_deploy_key is set: clone using ssh key
  • if neither acces_token or ssh_deploy_key are set: do a basic clone

The other GHA I am using is https://github.com/cpina/github-action-push-to-another-repository which alraedy supports SSH deploy keys which is where I borrowed some of the code to add support in for your action.

Let me know if this is something you are open to allowing for in your GHA!

Gracefully handle existing branches

Currently, if an existing branch exists, then it will end the run

| Error: The branch name v0.0.2 is already used.
[Run/build]   โŒ  Failure - Main Create new branch
[Run/build] exitcode '1': failure
[Run/build]   โŒ  Failure - Main ddymko/create-other-repo-branch-action@updates3
[Run/build] exitcode '1': failure

It would be nice if we could add in a new input parameter that would allow a graceful exit so that our flow could continue.

The solution I am currently testing is as follows:

        if ${{ inputs.ignore_branch_exists }} && [ ! -z $(git branch --remotes --list 'origin/${{ inputs.new_branch_name }}') ]; then
            echo "[INFO] Branch ${{ inputs.new_branch_ref }} already exists. Skipping branch creation"
            exit 0
        fi

The other option is to augment the existing branch check. I am happy to submit a PR with what I have if you are open to the suggestion!

could not read Username for 'https://github.com': No such device or address

Trying to test this action however when running the workflow, I get the following error message:

image

I've tried different ways to get this to work such as specifying the git username and email. setting the GH_TOKEN at the global workflow level and running actions/checkout@v3 but no luck. any advice here?

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.