Skip to content

Unable to create Github Pull Request using gh CLI client #344

Open
@fenech

Description

@fenech

If I fetch code from a repo with a get step and pass the directory as an input to a task, I cannot open a PR using gh pr create --fill. Example task:

inputs: [{name: repo}]
params:
  TOKEN: # access token with write access to the repo and org:read
run:
  path: bash
  dir: repo
  args:
    - -c
    - |
        touch file
        git checkout -B test
        git commit -am test
        git push -u origin test
        gh auth login --with-token <<<"$TOKEN"
        gh pr create --fill

The final command attempts to open a pull request between the new branch and the default branch, but it seems that the repository is incomplete, so it triggers a prompt rather than opening the PR.

Running a git clone within the task works as expected: the PR is opened with no prompt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions