Commit graph

4567 commits

Author SHA1 Message Date
William Martin
db8b38a185 Fix secret command panic when base repo from cwd 2025-03-06 11:45:22 +01:00
Meredith Lancaster
4d44e4f20c
Merge pull request #10382 from malancas/refactor-get-attestations-funcs
Refactor `GetLocalAttestations` and clean up custom registry transport
2025-03-05 11:46:36 -07:00
Meredith Lancaster
917a00ddc1
Update pkg/cmd/attestation/verification/attestation.go
Co-authored-by: Fredrik Skogman <kommendorkapten@github.com>
2025-03-05 07:31:35 -07:00
Meredith Lancaster
ddc36c8a8e
Update pkg/cmd/attestation/verification/attestation.go
Co-authored-by: Fredrik Skogman <kommendorkapten@github.com>
2025-03-05 07:31:28 -07:00
Andy Feller
23ea61d325 Expand gh secret base repo tests
Building on top of the work done in commands to account for GH_REPO environment variable, this commit expands existing tests around handling base repo functions to include new test scenarios.

These tests fail in the same way as reported on the issue when run against `trunk` without the other branch's changes, demonstrating they will help avoid regression.
2025-03-04 13:39:38 -05:00
Azeem Sajid
d67d65e304 [gh secret] Check GH_REPO too in addition to --repo for disambiguation 2025-03-04 18:36:53 +01:00
Meredith Lancaster
671c4c23a9 Merge branch 'trunk' into refactor-get-attestations-funcs 2025-03-04 09:33:00 -07:00
Andy Feller
5e21f6ac17
Merge pull request #10521 from cli/jtmcg/fix-workflow-panic
Fix unhandled panic in FindWorkflow and add tests
2025-03-03 13:14:49 -05:00
Tyler McGoffin
a18c54e824 Fix unhandled panic in FindWorkflow and add tests
FindWorkflow had a code path that could error without handling that error
that was introduced in #10328. I previously called out the lack of tests
in this part of the code in my review, and punting them then bit us here:
https://github.com/cli/cli/pull/10328#pullrequestreview-2597266783.

As such, this fixes the panic, but also adds tests to cover the relevant
code paths through FindWorkflow, including some tests for getWorkflowByID,
getWorkflowsByName, and GetWorkflows.

This does NOT seek to refactor the existing code, just cover the existing
behavior and validate that we are resolving this panic (covered by
TestFindWorkflow_nonHTTPError).
2025-02-28 15:11:53 -08:00
William Martin
f8d9aac7e5
Merge pull request #10512 from cli/wm-kw/fix-pr-checkout-for-forks
Fix checkout when URL arg is from fork and cwd is upstream
2025-02-28 13:31:59 +01:00
William Martin
11b9496e17 Fix checkout when URL arg is from fork and cwd is upstream 2025-02-27 16:56:11 +01:00
Andy Feller
f9d50d86ac
Merge pull request #10508 from iamazeem/10449-inconsistent-examples-format
Inconsistent format of examples in help text
2025-02-27 09:15:14 -05:00
Azeem Sajid
515bb96b2f Update project help text; fix unlink usage 2025-02-27 17:51:05 +05:00
Azeem Sajid
33c30d5bd1 Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
Azeem Sajid
69fff52026
Inconsistent format of description of flags (starting with lowercase letter) (#10507) 2025-02-27 11:40:21 +01:00
Meredith Lancaster
33d863f98d
Merge pull request #10308 from malancas/attestation-verify-ref-commit-policy-opts
Add signer-digest, source-ref, and source-digest options for `gh attestation verify`
2025-02-26 14:27:31 -07:00
Tyler McGoffin
ed2c322a73
Merge pull request #10384 from iamazeem/9798-gh-api-encode-package-name
[gh api] Escape package name (URL encoding) for packages endpoint
2025-02-25 11:12:48 -08:00
William Martin
f019cf7cea
Merge pull request #10501 from cli/wm/fix-minor-auth-login-help
Fix minor auth login help typo
2025-02-25 16:47:38 +01:00
William Martin
ac6ad78ff9 Fix minor auth login help typo 2025-02-25 12:27:30 +01:00
Azeem Sajid
9c87069199 Add docs; rename function name 2025-02-25 10:37:14 +05:00
Kynan Ware
756f4ec04a
Merge pull request #10490 from cli/kw/cli-10095-document-how-to-revoke-oauth-tokens
docs: document how to revoke `gh` OAuth tokens in `auth logout`'s help
2025-02-24 14:24:44 -07:00
Kynan Ware
d68a4daa8c
docs: OAuth doc link moves to newline
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-02-24 14:12:19 -07:00
Meredith Lancaster
ba5cf8e1ce
Merge branch 'trunk' into attestation-verify-ref-commit-policy-opts 2025-02-24 10:59:58 -07:00
Meredith Lancaster
343d9babeb fix expected test output
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-02-24 10:51:34 -07:00
Meredith Lancaster
37a91ebfdb undo regex changes
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-02-24 10:47:39 -07:00
Meredith Lancaster
ce87c746b2 remove signer-ref option
Signed-off-by: Meredith Lancaster <malancas@github.com>
2025-02-24 10:44:29 -07:00
Kynan Ware
736447cca4 docs: warn about process revoking all tokens 2025-02-23 18:24:28 +00:00
Kynan Ware
e2f382c44d docs: document how to revoke gh OAuth tokens
This documents how to revoke OAuth tokens generated by `gh`. This also
adjusts some language to match the language used by GitHub.com:
"invalidate" is now "revoke".
2025-02-23 18:12:06 +00:00
beforetech
563c2f9e18 refactor: use a more straightforward return value
Signed-off-by: beforetech <mail@before.tech>
2025-02-23 22:59:33 +08:00
William Martin
537a22228c
Merge pull request #10479 from latzskim/gh-pr-checkout-with-no-tags
Do not fetch tags on PR checkout.
2025-02-21 13:12:29 +01:00
William Martin
437c52f807 Test pr checkout force on different branch 2025-02-21 13:00:48 +01:00
latzskim
e331daabce [gh pr checkout] Add --no-tags option to git fetch commands in checkout logic 2025-02-20 19:04:16 +01:00
William Martin
db823c18b8 Allow injection of TUFMetadataDir in tests
This avoids multiple tests using the same dir for metadata, which was causing flakes
2025-02-20 17:04:30 +01:00
William Martin
b61f2efcac Refactor remote resolver caching tests 2025-02-20 13:15:56 +01:00
Azeem Sajid
f236c7efab Fix remoteResolver caching issue 2025-02-20 13:15:23 +01:00
Kynan Ware
ab9f685d0a
Merge pull request #10427 from latzskim/create-if-none
[gh issue/pr comment] Create a comment if no comment already exists
2025-02-19 12:38:15 -07:00
Tyler McGoffin
5aa36de302
Merge pull request #10327 from iamazeem/9897-gh-cache-delete-exit-code
[gh cache delete --all] Add `--succeed-on-no-caches` flag to return exit code 0
2025-02-19 10:34:29 -08:00
latzskim
26414865c4 Address pr comments 2025-02-19 16:56:23 +01:00
William Martin
94b50caa19 Add test for item-edit --number 0 2025-02-19 12:39:14 +01:00
Aryan Bhosale
bf37ac9a69 Support setting project item number to 0 2025-02-19 12:31:17 +01:00
William Martin
1710f7dace
Merge pull request #10398 from iamazeem/6059-gh-release-create-only-new
[gh release create] Fail when there are no new commits since the last release
2025-02-19 12:13:55 +01:00
Azeem Sajid
8202471910 Wrap error 2025-02-19 16:03:24 +05:00
Azeem Sajid
960017a4f1 Rename flag to --fail-on-no-commits 2025-02-19 15:20:17 +05:00
Azeem Sajid
9389628323 Update tests 2025-02-19 10:31:20 +05:00
Azeem Sajid
db8e81009c Merge branch '9897-gh-cache-delete-exit-code' of github.com:iamazeem/cli into 9897-gh-cache-delete-exit-code 2025-02-19 10:22:53 +05:00
Azeem Sajid
76efb5ac81 Fix non-TTY case 2025-02-19 10:22:31 +05:00
Andy Feller
c69e88ef6b
Merge pull request #10458 from daviddl9/update-pr-create
update default upstream when forking repo during PR creation
2025-02-18 16:24:51 -05:00
Andy Feller
af99c9d495 Suggestions to enhance upstream default handling
This commit brings this code more into alignment with other places:

1. Using a local variable for upstream remote name instead of hardcoding everywhere
2. Raising error raised by setting default remote
3. Removing condition for displaying upstream default message
4. Bring message logic more inline with other places within function
2025-02-18 16:02:50 -05:00
Azeem Sajid
72364562dd Use API REST Client 2025-02-18 21:49:38 +05:00
William Martin
9c90e3aac9 Use subtests in attestation verification integration tests 2025-02-18 16:44:48 +01:00