Skip to content

Work out PR number for head branch #119

Closed
@gibfahn

Description

@gibfahn

It'd be nice if I could do get-metadata (or get-metadata @) if I'm on a fork branch with an open PR.

Could do something like:

# Get the remote url of the upstream branch (if it exists).
remote=$(git remote get-url $(git rev-parse --abbrev-ref --symbolic-full-name @{u} | cut -d / -f 1))
branch=$(git symbolic-ref --short HEAD) # Or branch parameter passed.

# Convert to https:// syntax if it's ssh syntax ([email protected])

# Work out what PR has that as a base branch

# Pass PR number through to the rest of get-metadata.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions