Commit graph

7854 commits

Author SHA1 Message Date
Meredith Lancaster
442111075c go mod tidy
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-10 08:04:51 -06:00
Meredith Lancaster
83519e4e92 check for sigstore-go validation errs
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-10 07:54:45 -06:00
Meredith Lancaster
70e935ba95 get latest sigstore-go commit
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-10 07:54:33 -06:00
Meredith Lancaster
bbefc5b24f handle os.PathError in GetLocalAttestations
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-09 08:53:11 -06:00
Meredith Lancaster
945e2b7eee
Merge branch 'trunk' into verification-err-output 2024-09-09 08:23:01 -06:00
William Martin
a3f9d85fc3
Merge pull request #9575 from cli/dependabot/github_actions/actions/attest-build-provenance-1.4.3
build(deps): bump actions/attest-build-provenance from 1.4.2 to 1.4.3
2024-09-09 10:17:38 +02:00
Cody Soyland
3b7b7a4752
Merge pull request #9578 from cli/bundle-panic
Check for nil values to prevent nil dereference panic
2024-09-06 16:17:53 -04:00
Cody Soyland
b14e430441
Check for nil values to prevent nil dereference panic
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-09-06 15:22:43 -04:00
Andy Feller
82b509958a
Merge pull request #9566 from cli/sigstore-go-v0.6.1
Upgrade sigstore-go to v0.6.1
2024-09-06 11:14:43 -04:00
dependabot[bot]
a21e78bf0d
build(deps): bump actions/attest-build-provenance from 1.4.2 to 1.4.3
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](6149ea5740...1c608d11d6)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-06 14:31:25 +00:00
William Martin
dd85d621c6
Merge pull request #9573 from cli/andyfeller/9569-remove-old-gpg-id-notes
Remove note explaining 2 year old GPG ID change
2024-09-06 14:56:32 +02:00
Andy Feller
5a7cdff9db Update linux install to point to GPG troubleshoot
Relates #9569

Updates notes from older 2 year GPG ID change to redirect users in case of GPG errors to recent issue.
2024-09-06 08:45:24 -04:00
Andy Feller
78fa57dff7 Revert "Remove note explaining 2 year old GPG ID change"
This reverts commit 043bdbedb9.
2024-09-06 08:41:59 -04:00
Andy Feller
043bdbedb9 Remove note explaining 2 year old GPG ID change
Relates #9569

Having been 2 years since the GitHub CLI changed GPG keys used to sign our releases, it no longer seems relevant to keep these notes in our installation docs as they are confusing to the uninitiated.
2024-09-06 08:36:04 -04:00
Meredith Lancaster
668706ccf5 print verify err
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-05 13:29:22 -06:00
Meredith Lancaster
57b20291bd check for os.PathError
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-05 13:20:13 -06:00
Meredith Lancaster
7c405e8b6e dont print err content
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-05 08:16:34 -06:00
Cody Soyland
ea1a3da1eb
Rename ProtobufBundle to Bundle
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-09-04 16:45:02 -04:00
Cody Soyland
8446079656
Upgrade to sigstore-go v0.6.1
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-09-04 16:38:13 -04:00
Meredith Lancaster
1b67b354a9 update bundle file parsing err messages
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-04 13:30:30 -06:00
Meredith Lancaster
34d7ef7a0e
gh attestation verify handles empty JSONL files (#9541)
* handle empty jsonl files

Signed-off-by: Meredith Lancaster <malancas@github.com>

* check processed attestations slice length

Signed-off-by: Meredith Lancaster <malancas@github.com>

* update err name and message

Signed-off-by: Meredith Lancaster <malancas@github.com>

---------

Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-04 10:31:41 -06:00
Aryan Bhosale
9a0a7d427e
verify 2nd artifact without swapping order (#9532)
* verify 2nd artifact without swapping order

possible solution to https://github.com/cli/cli/issues/9521#issuecomment-2310686619?

* copy the mentioned test file and adds some extra lines

* rm unnecessary import

* Update pkg/cmd/attestation/verification/attestation_test.go

Co-authored-by: Meredith Lancaster <malancas@users.noreply.github.com>

* gofmt

---------

Co-authored-by: Meredith Lancaster <malancas@users.noreply.github.com>
2024-09-04 08:57:56 -06:00
William Martin
2bd3c22903
Merge pull request #9555 from crystalstall/trunk
chore: fix some function names
2024-09-02 11:43:32 +02:00
crystalstall
5562c1489f chore: fix some function names
Signed-off-by: crystalstall <crystalruby@qq.com>
2024-09-02 15:18:42 +08:00
Zongle Wang
192f57ef42
Improve the help message for -F (#9525)
Changing to `release-notes.md` from `changelog.md` may help users better contextually understand usage.

Co-authored-by: Tyler McGoffin <jtmcg@github.com>
2024-08-28 11:00:46 -07:00
Andy Feller
327451627c
Merge pull request #9509 from muzimuzhi/typo/repo-sync
Fix doc typo for `repo sync`
2024-08-28 09:29:24 -04:00
dependabot[bot]
b8db372d71
build(deps): bump actions/attest-build-provenance from 1.4.1 to 1.4.2 (#9518)
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](310b0a4a3b...6149ea5740)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler McGoffin <jtmcg@github.com>
2024-08-26 10:26:42 -07:00
Aryan Bhosale
8305a49c3f
"offline" verification using the bundle of attestations without any additional handling of the file (#9523) 2024-08-26 09:58:29 -06:00
Andy Feller
19daa35c81
Merge pull request #9482 from benebsiny/cli-9153
fix the trimming of log filenames for `gh run view`
2024-08-22 15:23:06 -04:00
Andy Feller
2695983e40
Merge pull request #9495 from muzimuzhi/web/drop-trailing-space-in-flag
Drop surplus trailing space char in flag names in web
2024-08-22 15:12:40 -04:00
Yukai Chou
687a43fe89 Drop surplus trailing space char in flag names in web
Introduced by 92cb2cc7 (more closely match cobra default val display,
2023-12-05).
2024-08-23 02:15:07 +08:00
Tyler McGoffin
91eb34011c
Remove Internal from gh repo create prompt when owner is not an org (#9465)
* Remove `Internal` from `gh repo create` prompt when owner is not an org

Closes #9464

Internal repos only exist for organizations, so when a user selects their
personal namespace to create a repo using `gh repo create`, `Internal`
should not be an option in the `Visibility` prompt.

This should avoid the additional quirk where if the user selects
`Internal` while creating a personal repo and then proceeds to add any
of the README, .gitignore, or LICENSE files prompted for later, the repo
will not error and instead get created as a `Public` repo. This has the
potential for a user to unknowingly leak sensitive info intended to go
into a non-public repo.

* Refactor prompter with test coverage

By extracting the repo visibility options to its own function,
getRepoVisibilityOptions, we're able to directly test the behavior
introduced with this change. This breaks the testing pattern established
here thus far, but may be a good example of the direction we should
explore for a future refactor.

* Add failing tests to check for error with internal vis in non-org repos

There is a bug in the code, currently, where a user repo can attempt to be
created as with `--internal` visibility flag  when that is not an option
for non-org repos. It fails at the API level if the --gitignore,
--license, or --add-readme flags are not included, but silently falls back
to Public visibility if one of them is included.

Because this bug already existed, this commit adds the tests to ensure
that both scenarios described above are captured accurately by the test
suite. A fix for the latter scenario will be coming in a future commit

* Add Exclude to httpmock registry and implement in Test_repoCreate

Upon attempting to make the previous commit pass, I realized that it was
actually impossible to test what I wanted to. The tests in the previous
commit were behaving as expected given the bug that commit described, but
upon attempting to implement a solution I realized that the tests were
only testing the mocks and not the code functionality itself.

Essentially, when the code to fix the bug was implemented, the tests were
failing because the mocks required to test the buggy behavior were no
longer being called. To make the tests pass, I'd have to rewrite them, but
were I to remove the bug fix, the tests would no longer fail.

This pointed me to a gap in our httpmocks - the ability to intentionally
exclude api calls. The behavior I'm trying to test, here, is that we stop
executing when a certain condition is met, and therefore won't make any
subsequent api calls down the chain.

This implements the Exclude method on the registry such that it will fail
if an excluded api pattern is called. I have refactored the tests in
Test_repoCreate to use the Exclude mock for testing.

* Add error if user attempts to create repo with --internal flag

This was previously failing at either the API if no other flags were
included or falling back to creating a public repo if one of gitignore,
license, or add-readme were included.

* Add testing for error messages in gh repo create

In the previous commits, we've introduced a new error when a user tries to
create an Internal repo not owned by an organization. This adds tests to
verify that the error we are getting is, in fact, the one associated with
this use case and not some random error.
2024-08-22 10:01:16 -07:00
Yukai Chou
2374e82633 Fix doc typo for repo sync 2024-08-23 00:17:31 +08:00
Eugene
ef9069a1b0
Merge pull request #9421 from cli/eugene/attestation/fetch-oci-bundle
Fetch bundle from OCI registry for verify
2024-08-22 09:54:03 -04:00
Yukai Chou
c81ccab4b8
Quote repo names consistently in gh repo sync stdout (#9491)
* Quote repo names consistently in `gh repo sync` stdout

* Update tests
2024-08-21 12:20:45 -07:00
Andy Feller
779a1203b6
Merge pull request #9471 from heaths/issue9470
Always print URL scheme to stdout
2024-08-21 14:46:52 -04:00
Eugene
e21d053faf
Merge branch 'trunk' into eugene/attestation/fetch-oci-bundle 2024-08-21 12:24:08 -04:00
ejahnGithub
0d38a2fd8e fixed the test 2024-08-21 10:52:42 -04:00
ejahnGithub
47a8f4bbdd update error message 2024-08-20 16:14:39 -04:00
Andy Feller
95a2f95f75
Merge pull request #9453 from cli/jtmcg/project-v2-syntax-in-search
Update `--project <number>` flags in `gh search` to `owner/number`
2024-08-20 07:42:17 -04:00
Andy Feller
4f681aaee1
Merge pull request #9477 from benebsiny/cli-9496
fix behavior for `gh issue develop -b does-not-exist-on-remote`
2024-08-19 16:42:07 -04:00
ejahnGithub
3fd309bdde rename flag to bundle-from-oci 2024-08-19 10:29:01 -04:00
William Martin
4283adbc40
Merge pull request #9396 from bryanhonof/trunk
Add Flox as an installation option
2024-08-19 13:59:35 +02:00
William Martin
d40175fbe5 Add flox to linux installation instructions 2024-08-19 13:48:45 +02:00
William Martin
7187db418b
Merge pull request #9439 from arunsathiya/update/9205-pr-checks-json-help-doc
cmd/pr/checks: Describe bucket and state JSON fields
2024-08-19 12:53:04 +02:00
benebsiny
64415df08d fix the trimming of log filenames for gh run view 2024-08-18 16:57:19 +08:00
EBIBO
08aafc5484
Update pkg/cmd/issue/develop/develop.go
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-08-18 09:25:39 +08:00
EBIBO
04b4122e61
Update api/queries_branch_issue_reference.go
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-08-18 09:25:30 +08:00
benebsiny
e269d43c5a add testing 2024-08-17 13:47:02 +08:00
benebsiny
216c283e03 Merge branch 'trunk' into cli-9496 2024-08-17 12:05:17 +08:00