Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh pr lock does not accept url even though it is mentioned in the manual #8816

Closed
alvinsjoy opened this issue Mar 14, 2024 · 1 comment · Fixed by #8837
Closed

gh pr lock does not accept url even though it is mentioned in the manual #8816

alvinsjoy opened this issue Mar 14, 2024 · 1 comment · Fixed by #8837
Labels
bug Something isn't working help wanted Contributions welcome p3 Affects a small number of users or is largely cosmetic

Comments

@alvinsjoy
Copy link

alvinsjoy commented Mar 14, 2024

Describe the bug

The gh pr lock {<number> | <url>} [flags] command is meant to accept pull request urls as per the manual but does accept them and shows an error: invalid issue format: "https://github.com/user/repo/pull/60".

image
The screenshot provided shows the command and the error.

gh version 2.43.1 (2024-01-31)

Steps to reproduce the behavior

  1. Type gh pr lock "https://github.com/username/repo/pull/number" using valid username, repo, pull request number.

Expected vs actual behavior

The gh pr lock command should accept url to the pr just like gh pr merge command accepts urls.

Logs

C:\dev\projects\GitHub\PortfolioWebsite>gh pr lock "https://github.com/alvinsjoy/PortfolioWebsite/pull/60" --reason reso
lved
invalid issue format: "https://github.com/alvinsjoy/PortfolioWebsite/pull/60"
C:\dev\projects\GitHub\PortfolioWebsite>gh --version
gh version 2.43.1 (2024-01-31)
https://github.com/cli/cli/releases/tag/v2.43.1
@alvinsjoy alvinsjoy added the bug Something isn't working label Mar 14, 2024
@cliAutomation cliAutomation added the needs-triage needs to be reviewed label Mar 14, 2024
@alvinsjoy alvinsjoy changed the title gh pr lock does not accept url even though it is mentioned in the manual gh pr lock does not accept url even though it is mentioned in the manual Mar 14, 2024
@williammartin
Copy link
Member

Agree this is a bug. The functionality backing this is expecting you to provide the issue URL rather than the PR URL i.e.

gh pr lock "https://github.com/alvinsjoy/PortfolioWebsite/issues/60" --reason resolved

This regex is no bueno:

var issueURLRE = regexp.MustCompile(`^/([^/]+)/([^/]+)/issues/(\d+)`)

I'll mark this as help wanted.

@williammartin williammartin added p3 Affects a small number of users or is largely cosmetic help wanted Contributions welcome and removed needs-triage needs to be reviewed labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contributions welcome p3 Affects a small number of users or is largely cosmetic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants