Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
353 commits
Select commit Hold shift + click to select a range
7dc7b98
Merge pull request #9052 from jasonodonnell/trunk
williammartin May 21, 2024
b1a6ce3
Update pkg title
paulober May 21, 2024
aeb0ac7
Update choice title
paulober May 21, 2024
eb23e07
Indentation fix
paulober May 21, 2024
f9d6b1d
Fix indentation
paulober May 21, 2024
80830d7
Fix indentation
paulober May 21, 2024
140edf7
feat: add support for stateReason in `gh pr view` (#9080)
nobe4 May 21, 2024
d2d599d
Undo goreleaser change
paulober May 21, 2024
6e58a2a
Fix indentation
paulober May 21, 2024
18f41db
Removed redundant specifications
paulober May 21, 2024
3830c33
Cleanup pkgmacos build script
paulober May 21, 2024
9454d5e
Change minimum build script macOS version
paulober May 21, 2024
105bafd
fix: rename the `Attempts` field to `Attempt`; expose in `gh run view…
cawfeecake May 22, 2024
e5e5c4f
Update regex in changedFilesNames to handle quoted paths
anda3 May 23, 2024
a66a646
Add comment to pr diff regex
williammartin May 23, 2024
99568e6
Merge pull request #9115 from anda3/feature/nonascii-path-regex-impro…
williammartin May 23, 2024
08a5589
Add a `gh variable get FOO` command (#9106)
arnested May 23, 2024
85f424b
Fix directory already exists
paulober May 24, 2024
74392ff
Added make macospkg target
paulober May 24, 2024
1990952
Fix distribution.xml + min macos version requirements
paulober May 24, 2024
27262ff
Added native min os version blocking
paulober May 24, 2024
b2fead7
build(deps): bump github.com/gabriel-vasile/mimetype from 1.4.3 to 1.4.4
dependabot[bot] May 24, 2024
f66367d
Integrate argument array to remove duplicate code
paulober May 24, 2024
4db8779
Merge branch 'trunk' into feature-macos-pkg-installer
paulober May 24, 2024
279d53a
Remove `v` prefix when `pkgmacos` is called
andyfeller May 24, 2024
bdc40a0
Update readme about MacOS pkg
andyfeller May 24, 2024
1bc3cfa
Merge pull request #7555 from paulober/feature-macos-pkg-installer
andyfeller May 24, 2024
d821942
Move `Variable` type and `PopulateSelectedRepositoryInformation` func…
babakks May 25, 2024
2a5a4ce
Add tests for JSON output
babakks May 25, 2024
9d8b783
Use `Variable` type defined in `shared` package
babakks May 25, 2024
9654907
Add `--json` option support
babakks May 25, 2024
ab85baa
Add test to verify JSON exporter gets set
babakks May 25, 2024
840ddc5
Only populate selected repo information for JSON output
babakks May 25, 2024
7add5a4
Add test for JSON output
babakks May 25, 2024
43e3e94
Add test for exporting as JSON
babakks May 25, 2024
94dff4d
Add `createdAt` field to `Variable` type
babakks May 25, 2024
4aa6f8f
Add `createdAt` field to tests
babakks May 25, 2024
8d05186
Add integration tests for `gh attestation verify` shared workflow use…
malancas May 28, 2024
e550933
Add build provenance for gh CLI releases (#9087)
malancas May 28, 2024
f1dedc9
Merge pull request #9124 from cli/dependabot/go_modules/github.com/ga…
williammartin May 28, 2024
f3f93c6
Build completions during release on macos
williammartin May 28, 2024
3620e79
Merge pull request #9136 from cli/wm/fix-pkgmacos-completions
williammartin May 29, 2024
2bb9900
Clarify Mac OS Installer packages are unsigned
andyfeller May 29, 2024
faef2dd
Merge pull request #9140 from cli/andyfeller/cli-9139-sign-pkg-predocs
andyfeller May 29, 2024
fe880a3
Ensure signed RPMs have attestations
andyfeller May 29, 2024
22991ab
Merge pull request #9143 from cli/andyfeller-patch-1
williammartin May 30, 2024
cd5562f
Add `signer-repo` and `signer-workflow` flags to `gh attestation veri…
malancas May 30, 2024
fc8b86b
Specify rpm repository to avoid conflicts with community repositories
hbenali May 30, 2024
31a9d08
Merge pull request #9151 from hbenali/fix-fedora
andyfeller May 30, 2024
5364a0c
add tests
wingleung Jun 2, 2024
29ad2b6
Merge remote-tracking branch 'upstream/trunk' into add-remote-check-t…
wingleung Jun 2, 2024
a10e532
feat: add `-a` flag to `gh run list`
joshuajtward Jun 3, 2024
3a1f385
Add GH_DEBUG to issue template
TWiStErRob Jun 4, 2024
215456e
build(deps): bump actions/attest-build-provenance from 1.1.2 to 1.2.0
dependabot[bot] Jun 4, 2024
e8a13cf
replaced deprecated --json-result flag with --format=json in the gh a…
phillmv Jun 4, 2024
58b459f
Merge pull request #9172 from cli/phillmv/fix-small-verify-flag-bug
phillmv Jun 4, 2024
d666248
build(deps): bump goreleaser/goreleaser-action from 5 to 6
dependabot[bot] Jun 5, 2024
e91860d
Bump go-keyring to fix keepassxc prompt confirmation
AlanD20 Jun 7, 2024
6f558c9
Merge pull request #9179 from AlanD20/bump-go-keyring
williammartin Jun 7, 2024
8ac5ad7
Merge branch 'trunk' into 8426-add-pr-update-cmd-no-local-update
babakks Jun 7, 2024
e36d8f1
Merge pull request #9169 from cli/dependabot/github_actions/actions/a…
williammartin Jun 10, 2024
1a470b3
build(deps): bump github.com/gorilla/websocket from 1.5.1 to 1.5.2
dependabot[bot] Jun 10, 2024
945b668
build(deps): bump google.golang.org/protobuf from 1.34.1 to 1.34.2
dependabot[bot] Jun 11, 2024
7cd4a15
Merge pull request #9175 from cli/dependabot/github_actions/gorelease…
andyfeller Jun 12, 2024
7d36c2d
Merge pull request #9192 from cli/dependabot/go_modules/github.com/go…
andyfeller Jun 12, 2024
04d0ec0
Merge pull request #9197 from cli/dependabot/go_modules/google.golang…
andyfeller Jun 12, 2024
c2f2753
add comment to call out potentially brittle use of workflowShared
joshuajtward Jun 13, 2024
f647131
Gracefully degrade when fetching annotations fails due to 403 (#9113)
wingleung Jun 13, 2024
6190e26
Add `gh run list` tests for workflow selector
andyfeller Jun 13, 2024
5e7ba54
Merge pull request #9162 from joshuajtward/chore/GH-9038
andyfeller Jun 13, 2024
307d07e
Update .github/ISSUE_TEMPLATE/bug_report.md
TWiStErRob Jun 13, 2024
59fae5b
build(deps): bump github.com/gorilla/websocket from 1.5.2 to 1.5.3
dependabot[bot] Jun 14, 2024
c572383
Attestation Verification - Buffer Fix (#9198)
Forrin Jun 14, 2024
f8e1271
Merge branch 'trunk' into 8426-add-pr-update-cmd-no-local-update
babakks Jun 16, 2024
6e77b2d
build(deps): bump github.com/spf13/cobra from 1.8.0 to 1.8.1
dependabot[bot] Jun 17, 2024
651d713
build(deps): bump actions/attest-build-provenance from 1.2.0 to 1.3.2
dependabot[bot] Jun 18, 2024
f71d3f7
Merge pull request #9222 from cli/dependabot/github_actions/actions/a…
andyfeller Jun 21, 2024
152607e
Removed beta note from `gh at verify`, clarified reusable workflows u…
phillmv Jun 24, 2024
40abc9a
Removed beta note from `gh at download`.
phillmv Jun 24, 2024
8318e7a
Actually, let's keep `download` in beta for now.
phillmv Jun 24, 2024
846b6ec
Fix whitespacing
williammartin Jun 24, 2024
d7c56bf
Remove beta note from attestation top level command
williammartin Jun 24, 2024
cdc8c4d
Merge pull request #9211 from cli/dependabot/go_modules/github.com/go…
williammartin Jun 24, 2024
31b424a
build(deps): bump github.com/google/go-containerregistry
dependabot[bot] Jun 24, 2024
f603231
Merge pull request #9218 from cli/dependabot/go_modules/github.com/sp…
williammartin Jun 24, 2024
06607d3
s/originated/caller/ workflow
phillmv Jun 24, 2024
ba2d32b
Merge pull request #9217 from cli/dependabot/go_modules/github.com/go…
williammartin Jun 24, 2024
c25dacc
Update pkg/cmd/attestation/verify/verify.go
phillmv Jun 24, 2024
c9f9fac
Update pkg/cmd/attestation/verify/verify.go
phillmv Jun 24, 2024
467550a
Merge pull request #9243 from cli/remove-attestation-public-beta
phillmv Jun 24, 2024
ee7bca6
build(deps): bump github.com/hashicorp/go-retryablehttp
dependabot[bot] Jun 24, 2024
812889f
Merge pull request #9128 from babakks/9118-add-json-fields-to-variabl…
williammartin Jun 25, 2024
85387fd
Update .github/ISSUE_TEMPLATE/bug_report.md
andyfeller Jun 25, 2024
70c3ca3
Merge pull request #9167 from TWiStErRob/patch-1
andyfeller Jun 25, 2024
d4e3385
Fetch variable selected repo relationship when required
williammartin Jun 25, 2024
c726703
Merge pull request #9256 from cli/9255-gh-variable-list-json-numselec…
andyfeller Jun 25, 2024
0f2e1ed
Merge pull request #9250 from cli/dependabot/go_modules/github.com/ha…
williammartin Jun 25, 2024
a994edd
Merge branch 'trunk' into 8426-add-pr-update-cmd-no-local-update
babakks Jun 27, 2024
f972050
gh attestation trusted-root subcommand (#9206)
steiza Jul 1, 2024
9b40e0c
Update create.go
cchristous Jul 7, 2024
0df5596
Merge pull request #9296 from cchristous/patch-1
williammartin Jul 8, 2024
8f77b4a
Add `issue create --editor`
notomo Mar 19, 2023
30b3286
Add prefer_editor_prompt config
notomo Jul 3, 2024
50d0cb7
Use prefer_editor_prompt config by `issue create`
notomo Jul 4, 2024
0d37174
Add editor hint message
notomo Jul 8, 2024
0b32e66
Enable to use --web even though editor is enabled by config
notomo Jul 9, 2024
4511a8b
build(deps): bump actions/attest-build-provenance from 1.3.2 to 1.3.3
dependabot[bot] Jul 10, 2024
172a9de
Ensure PR does not panic when stateReason is requested
williammartin Jul 11, 2024
3b2ba9e
docs: Update documentation for `gh repo create` to clarify owner
jessehouwing Jul 12, 2024
db733e1
Merge pull request #9305 from cli/dependabot/github_actions/actions/a…
williammartin Jul 12, 2024
ca1f2a4
Merge pull request #9309 from jessehouwing/docs/gh-repo-create-owner
williammartin Jul 12, 2024
940b54c
Add tests for JSON field support on issue and pr view commands
williammartin Jul 11, 2024
f44f9a4
Merge pull request #9307 from cli/wm/9160-stateReason-panic
williammartin Jul 12, 2024
28cc56c
Raise error if editor is used in non-tty mode
notomo Jul 13, 2024
ae5a71b
Merge branch 'trunk' into add-issue-create-editor
andyfeller Jul 15, 2024
9b7ee3a
Merge pull request #7193 from notomo/add-issue-create-editor
andyfeller Jul 15, 2024
c70479a
Merge branch 'trunk' into 8426-add-pr-update-cmd-no-local-update
babakks Jul 16, 2024
171e8d3
Print message on stdout instead of stderr
babakks Jul 16, 2024
1a6f598
Remove unused flag
babakks Jul 16, 2024
feb5aa5
Add separate type for `PullRequest.Mergeable` field
babakks Jul 16, 2024
28c72eb
Replace literals with consts for `Mergeable` field values
babakks Jul 16, 2024
497a915
Return error if PR is not mergeable
babakks Jul 16, 2024
5d2378d
Handle merge conflict error
babakks Jul 16, 2024
989152e
Add test case for merge conflict error
babakks Jul 16, 2024
b584895
Rename `gh pr update` to `gh pr update-branch`
babakks Jul 17, 2024
5b71586
Rename package name to `update_branch`
babakks Jul 17, 2024
5b918cf
Rename package directory and files
babakks Jul 17, 2024
d3d73d9
Merge pull request #8953 from babakks/8426-add-pr-update-cmd-no-local…
williammartin Jul 17, 2024
e0c03fc
Remove redundant whitespace
jessehouwing Jul 18, 2024
d02f58f
Merge pull request #9334 from jessehouwing/patch-1
williammartin Jul 18, 2024
a81a1f7
Remove attestation test that requires being online (#9340)
steiza Jul 19, 2024
17257df
Verify `--body` and `--body-file` are not assignable at the same time
babakks Jul 21, 2024
9dabc3b
Remove unused expected `output` from test case (with `wantsErr: true`)
babakks Jul 21, 2024
683576d
Add `--remove-milestone` option
babakks Jul 21, 2024
168a883
Assert correct parsing of `--remove-milestone` option
babakks Jul 21, 2024
42da8ba
Verify `--milestone` and `--remove-milestone` are not assignable at t…
babakks Jul 21, 2024
0a3a128
Exit with 1 on authentication failure
Stausssi Jun 23, 2024
a6a1a58
Update documentation for gh api PATCH
cmbuckley Jul 22, 2024
e760636
document exit code behavior
Stausssi Jul 22, 2024
a4da98d
Merge pull request #9352 from cmbuckley/docs-api-patch
williammartin Jul 22, 2024
32e499e
Add examples for template usage in PR and issue creation
williammartin Jul 23, 2024
8a0d361
Expose fullDatabaseId for PR json export
williammartin Jun 23, 2024
13dea3e
Add test for release view json export fields
williammartin Jul 23, 2024
99ff84b
Alphabetise release json fields
williammartin Jul 23, 2024
c13d161
Export databaseId for releases
williammartin Jul 23, 2024
5df84b5
Merge pull request #9354 from cli/9220-getting-template-not-found-err…
andyfeller Jul 23, 2024
78c3361
Merge pull request #9356 from cli/9278-gh-release-view-with-json-pars…
andyfeller Jul 23, 2024
c16becc
Slightly clarify when CLI will exit with 4
williammartin Jul 23, 2024
adc8b82
Merge pull request #9355 from cli/wm/9241-fulldatabaseid
williammartin Jul 24, 2024
fd51a69
Handle `--bare` clone targets (#9271)
Jul 24, 2024
8da9ee2
Merge pull request #9358 from cli/9338-gh-attestation-can-fail-with-h…
andyfeller Jul 24, 2024
658f125
Update sigstore-go in gh CLI to v0.5.1 (#9366)
steiza Jul 25, 2024
18894b6
Merge branch 'trunk' into fix-8845
andyfeller Jul 26, 2024
30f3a38
Merge pull request #9240 from Stausssi/fix-8845
andyfeller Jul 26, 2024
1fb6df6
build(deps): bump github.com/gabriel-vasile/mimetype from 1.4.4 to 1.4.5
dependabot[bot] Jul 26, 2024
9362143
Merge branch 'trunk' into 9292-add-remove-milestone-option
babakks Jul 28, 2024
6e34e81
Point to `Editable.MilestoneId` method
babakks Jul 28, 2024
4c8ec84
Improve `--remove-milestone` option description
babakks Jul 28, 2024
1520292
Add `--remove-milestone` option
babakks Jul 28, 2024
6dc8cc4
Verify `--body` and `--body-file` are not assignable at the same time
babakks Jul 28, 2024
605b4b1
Assert correct parsing of `--remove-milestone` option
babakks Jul 28, 2024
c9fb4ed
Verify `--milestone` and `--remove-milestone` are not assignable at t…
babakks Jul 28, 2024
d527775
Merge pull request #9372 from cli/dependabot/go_modules/github.com/ga…
andyfeller Jul 29, 2024
fbae0e2
build(deps): bump github.com/google/go-containerregistry
dependabot[bot] Jul 29, 2024
0d87dda
Merge pull request #9373 from cli/dependabot/go_modules/github.com/go…
andyfeller Jul 29, 2024
457274b
Merge branch 'trunk' into 9292-add-remove-milestone-option
babakks Jul 29, 2024
842562d
Use closure-scoped variable to catch `--remove-milestone` option
babakks Jul 29, 2024
a73ae65
Use closure-scoped variable to catch `--remove-milestone` option
babakks Jul 29, 2024
58e6196
Fix missing variable
babakks Jul 29, 2024
b05bddc
Merge pull request #9344 from babakks/9292-add-remove-milestone-option
andyfeller Jul 29, 2024
b996380
Use signature-stripped tag annotation content
babakks Jul 29, 2024
df3b062
Add test for `gitTagInfo`
babakks Jul 29, 2024
46814b3
Add example for `--notes-from-tag`
babakks Jul 29, 2024
8ea1b89
Update tests with changes to `gitTagInfo` function
babakks Jul 29, 2024
dc4e9cb
handle attest case insensitivity
ejahnGithub Jul 30, 2024
c1adb1a
added
ejahnGithub Jul 30, 2024
e21e5ef
update test
ejahnGithub Jul 30, 2024
580ddf6
minor fix
ejahnGithub Jul 30, 2024
596ee8b
update test
ejahnGithub Jul 30, 2024
12715fd
Merge branch 'trunk' into eugene/gh-attestation-case-insensitivity
ejahnGithub Jul 30, 2024
a7d04fc
Add Flox as an installation option
Jul 30, 2024
1eaf712
update test and remove logic to check SourceRepositoryOwnerURI is emp…
ejahnGithub Jul 31, 2024
87ff22d
Merge branch 'tmp-07-31' into eugene/gh-attestation-case-insensitivity
ejahnGithub Jul 31, 2024
ad96ad3
build(deps): bump actions/attest-build-provenance from 1.3.3 to 1.4.0
dependabot[bot] Jul 31, 2024
89cbcfe
Merge pull request #9392 from cli/eugene/gh-attestation-case-insensit…
ejahnGithub Jul 31, 2024
22a5a4c
Update `gh variable get` to use repo host
andyfeller Aug 2, 2024
d7b8ecf
Unify use of tab indent in non-test source files
muzimuzhi Aug 1, 2024
c088951
Fix host handling in variable and secret delete
andyfeller Aug 2, 2024
626bbf0
Merge pull request #9411 from cli/andyfeller/cli-9274-gh-variable-get…
andyfeller Aug 6, 2024
983e13c
Merge pull request #9400 from cli/dependabot/github_actions/actions/a…
andyfeller Aug 6, 2024
000b2f9
Merge branch 'trunk' into tab-indents
andyfeller Aug 6, 2024
86964d8
Merge pull request #9407 from muzimuzhi/tab-indents
andyfeller Aug 6, 2024
8356df0
build(deps): bump github.com/google/go-containerregistry
dependabot[bot] Aug 7, 2024
e2275d7
Add `pr create --editor`
benebsiny Aug 7, 2024
c5ea30d
Add Acceptance Criteria requirement to triage.md for accepted issues
jtmcg Aug 7, 2024
fa06623
Update docs/triage.md
jtmcg Aug 7, 2024
40ccd2e
Merge pull request #9435 from cli/add-AC-to-triage-reqs
jtmcg Aug 7, 2024
e18c002
Deduplicate the initialization of editor mode
benebsiny Aug 8, 2024
330a385
Document that `gh run download` downloads the latest artifact by default
sato11 Aug 8, 2024
ab34d86
Change `gh repo set-default --view` to print to `stderr` when no defa…
thecaffeinedev Aug 8, 2024
dbcac5a
Merge pull request #9412 from sato11/docs-run-download-n
andyfeller Aug 8, 2024
7fe14ee
Merge pull request #9432 from cli/dependabot/go_modules/github.com/go…
andyfeller Aug 9, 2024
574e131
Require Sigstore Bundle v0.3 when verifying with `gh attestation`
codysoyland Aug 9, 2024
b783441
Fix tests
codysoyland Aug 9, 2024
35b2cf7
Change to requiring bundle v0.2
codysoyland Aug 9, 2024
18d58b8
Replace `--project.*` flags' `name` with `title` in docs (#9443)
jtmcg Aug 9, 2024
ac77d67
Wrap flags with backticks, continued
muzimuzhi Aug 10, 2024
3ca7090
Merge pull request #9444 from muzimuzhi/docs/unify-markup
andyfeller Aug 10, 2024
b36b39d
Explain why not looking for signature begin marker
babakks Aug 10, 2024
668dbce
Add test cases for PGP, SSH and X.509 signatures
babakks Aug 10, 2024
6dc7297
Merge branch 'trunk' into 9299-improve-annotated-releases
babakks Aug 10, 2024
1d03581
Merge remote-tracking branch 'upstream/trunk' into add-remote-check-t…
wingleung Aug 12, 2024
81e7ecd
prompt to select a repo in interactive mode
wingleung Aug 12, 2024
df723bd
fix lint
wingleung Aug 12, 2024
58ff5c4
Merge pull request #9385 from babakks/9299-improve-annotated-releases
andyfeller Aug 12, 2024
369a105
Minor grammatical fix
andyfeller Aug 12, 2024
a863dfd
Merge pull request #9433 from benebsiny/cli-9310
andyfeller Aug 12, 2024
da43f6e
build(deps): bump actions/attest-build-provenance from 1.4.0 to 1.4.1
dependabot[bot] Aug 12, 2024
f33c989
Merge pull request #9451 from cli/dependabot/github_actions/actions/a…
andyfeller Aug 12, 2024
e5248b8
Update `gh search prs --project` flag doc to specify `owner/number` s…
jtmcg Aug 12, 2024
c838da9
Update `gh search issues --project` flag doc to specify `owner/number…
jtmcg Aug 12, 2024
9e27af9
Merge pull request #9442 from cli/require-sigstore-bundle-v0.3
codysoyland Aug 13, 2024
025dcc8
Use latest checkout version, generate attestations, and specify go ve…
BagToad Aug 14, 2024
820f4f3
Do not generate build attestations for otherBinWorkflow.yml
BagToad Aug 14, 2024
0835642
build(deps): bump github.com/creack/pty from 1.1.21 to 1.1.23 (#9459)
dependabot[bot] Aug 14, 2024
5b7070f
include required permissions to generate attestations
BagToad Aug 14, 2024
4618a26
Update attestation TUF root
codysoyland Aug 15, 2024
d707102
Add a note about external contributors to `working-with-us.md`
BagToad Aug 15, 2024
0e690fa
Merge pull request #9462 from cli/9394-update-go-extension-workflow-t…
andyfeller Aug 15, 2024
0140e3d
Merge pull request #9468 from cli/BagToad-external-contributors-note
BagToad Aug 15, 2024
255f530
Merge pull request #9467 from cli/attestation-tuf-root-update
kommendorkapten Aug 16, 2024
5798eb7
use default set remote if available
wingleung Aug 16, 2024
c4e3204
Merge remote-tracking branch 'upstream/trunk' into add-remote-check-t…
wingleung Aug 16, 2024
01f1935
add todos for tests
wingleung Aug 16, 2024
1886fb4
Fix pr checks exit code (#9452)
thecaffeinedev Aug 16, 2024
800f99d
Describe bucket and state JSON fields in pr checks command
arunsathiya Aug 9, 2024
56e1cda
fix behavior for `issue develop -b non-exist-branch`
benebsiny Aug 17, 2024
216c283
Merge branch 'trunk' into cli-9496
benebsiny Aug 17, 2024
e269d43
add testing
benebsiny Aug 17, 2024
04b4122
Update api/queries_branch_issue_reference.go
benebsiny Aug 18, 2024
08aafc5
Update pkg/cmd/issue/develop/develop.go
benebsiny Aug 18, 2024
7187db4
Merge pull request #9439 from arunsathiya/update/9205-pr-checks-json-…
williammartin Aug 19, 2024
d40175f
Add flox to linux installation instructions
williammartin Aug 19, 2024
4283adb
Merge pull request #9396 from bryanhonof/trunk
williammartin Aug 19, 2024
4f681aa
Merge pull request #9477 from benebsiny/cli-9496
andyfeller Aug 19, 2024
95a2f95
Merge pull request #9453 from cli/jtmcg/project-v2-syntax-in-search
andyfeller Aug 20, 2024
5212f12
Revert "use default set remote if available"
wingleung Aug 21, 2024
0f9ad3b
update docs for set-default
wingleung Aug 21, 2024
4854efb
Merge remote-tracking branch 'upstream/trunk' into add-remote-check-t…
wingleung Aug 21, 2024
97b1037
update setdefault test
wingleung Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ A clear and concise description of what you expected to happen and what actually
### Logs

Paste the activity from your command line. Redact if needed.

<!-- Note: Set `GH_DEBUG=true` for verbose logs or `GH_DEBUG=api` for verbose logs with HTTP traffic details. -->
29 changes: 25 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ concurrency:
cancel-in-progress: true

permissions:
attestations: write
contents: write
id-token: write

on:
workflow_dispatch:
Expand Down Expand Up @@ -38,7 +40,7 @@ jobs:
with:
go-version-file: 'go.mod'
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
version: "~1.17.1"
install-only: true
Expand Down Expand Up @@ -90,7 +92,7 @@ jobs:
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k "$keychain_password" "$keychain"
rm "$RUNNER_TEMP/cert.p12"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
version: "~1.17.1"
install-only: true
Expand All @@ -108,6 +110,19 @@ jobs:
run: |
shopt -s failglob
script/sign dist/gh_*_macOS_*.zip
- name: Build universal macOS pkg installer
if: inputs.environment != 'production'
env:
TAG_NAME: ${{ inputs.tag_name }}
run: script/pkgmacos "$TAG_NAME"
- name: Build & notarize universal macOS pkg installer
if: inputs.environment == 'production'
env:
TAG_NAME: ${{ inputs.tag_name }}
APPLE_DEVELOPER_INSTALLER_ID: ${{ vars.APPLE_DEVELOPER_INSTALLER_ID }}
run: |
shopt -s failglob
script/pkgmacos "$TAG_NAME"
- uses: actions/upload-artifact@v4
with:
name: macos
Expand All @@ -116,7 +131,8 @@ jobs:
path: |
dist/*.tar.gz
dist/*.zip

dist/*.pkg

windows:
runs-on: windows-latest
environment: ${{ inputs.environment }}
Expand All @@ -129,7 +145,7 @@ jobs:
with:
go-version-file: 'go.mod'
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
version: "~1.17.1"
install-only: true
Expand Down Expand Up @@ -281,6 +297,11 @@ jobs:
run: |
cp script/rpmmacros ~/.rpmmacros
rpmsign --addsign dist/*.rpm
- name: Attest release artifacts
if: inputs.environment == 'production'
uses: actions/attest-build-provenance@310b0a4a3b0b78ef57ecda988ee04b132db73ef8 # v1.4.1
with:
subject-path: "dist/gh_*"
- name: Run createrepo
env:
GPG_SIGN: ${{ inputs.environment == 'production' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Download dependencies
run: go mod download

- name: Run tests
run: go test -race ./...
- name: Run unit and integration tests
run: go test -race -tags=integration ./...

- name: Build
run: go build -v ./cmd/gh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
go mod verify
go mod download

LINT_VERSION=1.54.1
LINT_VERSION=1.59.1
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
tar xz --strip-components 1 --wildcards \*/golangci-lint
mkdir -p bin && mv golangci-lint bin/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/.goreleaser.generated.yml
/script/build
/script/build.exe
/pkg_payload
/build/macOS/resources

# VS Code
.vscode
Expand Down
7 changes: 3 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ release:

before:
hooks:
- >-
- >- # The linux and windows archives package the manpages below
{{ if eq .Runtime.Goos "windows" }}echo{{ end }} make manpages GH_VERSION={{.Version}}
- >-
{{ if ne .Runtime.Goos "linux" }}echo{{ end }} make completions

- >- # On linux the completions are used in nfpms below, but on macos they are used outside in the deployment build.
{{ if eq .Runtime.Goos "windows" }}echo{{ end }} make completions
builds:
- id: macos #build:macos
goos: [darwin]
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,11 @@ uninstall:
rm -f ${DESTDIR}${datadir}/bash-completion/completions/gh
rm -f ${DESTDIR}${datadir}/fish/vendor_completions.d/gh.fish
rm -f ${DESTDIR}${datadir}/zsh/site-functions/_gh

.PHONY: macospkg
macospkg: manpages completions
ifndef VERSION
$(error VERSION is not set. Use `make macospkg VERSION=vX.Y.Z`)
endif
./script/release --local "$(VERSION)" --platform macos
./script/pkgmacos $(VERSION)
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ If you are a hubber and are interested in shipping new commands for the CLI, che

### macOS

`gh` is available via [Homebrew][], [MacPorts][], [Conda][], [Spack][], [Webi][], and as a downloadable binary from the [releases page][].
`gh` is available via [Homebrew][], [MacPorts][], [Conda][], [Spack][], [Webi][], and as a downloadable binary including Mac OS installer `.pkg` from the [releases page][].

> [!NOTE]
> As of May 29th, Mac OS installer `.pkg` are unsigned with efforts prioritized in [`cli/cli#9139`](https://github.com/cli/cli/issues/9139) to support signing them.

#### Homebrew

Expand Down Expand Up @@ -57,6 +60,14 @@ Additional Conda installation options available on the [gh-feedstock page](https

For more information about the Webi installer see [its homepage](https://webinstall.dev/).

#### Flox

| Install: | Upgrade: |
| ----------------- | ----------------------- |
| `flox install gh` | `flox upgrade toplevel` |

For more information about Flox, see [its homepage](https://flox.dev)

### Linux & BSD

`gh` is available via:
Expand Down
3 changes: 3 additions & 0 deletions api/queries_branch_issue_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func FindRepoBranchID(client *Client, repo ghrepo.Interface, ref string) (string

branchID := query.Repository.Ref.Target.Oid
if branchID == "" {
if ref != "" {
return "", "", fmt.Errorf("could not find branch %q in %s", ref, ghrepo.FullName(repo))
}
branchID = query.Repository.DefaultBranchRef.Target.Oid
}

Expand Down
2 changes: 1 addition & 1 deletion api/queries_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func IssueStatus(client *Client, repo ghrepo.Interface, options IssueStatusOptio
}
}
}
}`
}`

variables := map[string]interface{}{
"owner": repo.RepoOwner(),
Expand Down
64 changes: 63 additions & 1 deletion api/queries_pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ type PullRequestAndTotalCount struct {
SearchCapped bool
}

type PullRequestMergeable string

const (
PullRequestMergeableConflicting PullRequestMergeable = "CONFLICTING"
PullRequestMergeableMergeable PullRequestMergeable = "MERGEABLE"
PullRequestMergeableUnknown PullRequestMergeable = "UNKNOWN"
)

type PullRequest struct {
ID string
FullDatabaseID string
Number int
Title string
State string
Expand All @@ -27,7 +36,7 @@ type PullRequest struct {
HeadRefName string
HeadRefOid string
Body string
Mergeable string
Mergeable PullRequestMergeable
Additions int
Deletions int
ChangedFiles int
Expand Down Expand Up @@ -607,6 +616,18 @@ func UpdatePullRequestReviews(client *Client, repo ghrepo.Interface, params gith
return err
}

func UpdatePullRequestBranch(client *Client, repo ghrepo.Interface, params githubv4.UpdatePullRequestBranchInput) error {
var mutation struct {
UpdatePullRequestBranch struct {
PullRequest struct {
ID string
}
} `graphql:"updatePullRequestBranch(input: $input)"`
}
variables := map[string]interface{}{"input": params}
return client.Mutate(repo.RepoHost(), "PullRequestUpdateBranch", &mutation, variables)
}

func isBlank(v interface{}) bool {
switch vv := v.(type) {
case string:
Expand Down Expand Up @@ -696,3 +717,44 @@ func BranchDeleteRemote(client *Client, repo ghrepo.Interface, branch string) er
path := fmt.Sprintf("repos/%s/%s/git/refs/heads/%s", repo.RepoOwner(), repo.RepoName(), url.PathEscape(branch))
return client.REST(repo.RepoHost(), "DELETE", path, nil, nil)
}

type RefComparison struct {
AheadBy int
BehindBy int
Status string
}

func ComparePullRequestBaseBranchWith(client *Client, repo ghrepo.Interface, prNumber int, headRef string) (*RefComparison, error) {
query := `query ComparePullRequestBaseBranchWith($owner: String!, $repo: String!, $pullRequestNumber: Int!, $headRef: String!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $pullRequestNumber) {
baseRef {
compare (headRef: $headRef) {
aheadBy, behindBy, status
}
}
}
}
}`

var result struct {
Repository struct {
PullRequest struct {
BaseRef struct {
Compare RefComparison
}
}
}
}
variables := map[string]interface{}{
"owner": repo.RepoOwner(),
"repo": repo.RepoName(),
"pullRequestNumber": prNumber,
"headRef": headRef,
}

if err := client.GraphQL(repo.RepoHost(), query, variables, &result); err != nil {
return nil, err
}
return &result.Repository.PullRequest.BaseRef.Compare, nil
}
27 changes: 19 additions & 8 deletions api/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ func StatusCheckRollupGraphQLWithCountByState() string {
contexts {
checkRunCount,
checkRunCountsByState {
state,
count
state,
count
},
statusContextCount,
statusContextCountsByState {
state,
count
state,
count
}
}
}
Expand Down Expand Up @@ -249,7 +249,7 @@ func RequiredStatusCheckRollupGraphQL(prID, after string, includeEvent bool) str
}`), afterClause, prID, eventField)
}

var IssueFields = []string{
var sharedIssuePRFields = []string{
"assignees",
"author",
"body",
Expand All @@ -270,14 +270,26 @@ var IssueFields = []string{
"url",
}

var PullRequestFields = append(IssueFields,
// Some fields are only valid in the context of issues.
// They need to be enumerated separately in order to be filtered
// from existing code that expects to be able to pass Issue fields
// to PR queries, e.g. the PullRequestGraphql function.
var issueOnlyFields = []string{
"isPinned",
"stateReason",
}

var IssueFields = append(sharedIssuePRFields, issueOnlyFields...)

var PullRequestFields = append(sharedIssuePRFields,
"additions",
"autoMergeRequest",
"baseRefName",
"changedFiles",
"commits",
"deletions",
"files",
"fullDatabaseId",
"headRefName",
"headRefOid",
"headRepository",
Expand Down Expand Up @@ -363,10 +375,9 @@ func IssueGraphQL(fields []string) string {
// PullRequestGraphQL constructs a GraphQL query fragment for a set of pull request fields.
// It will try to sanitize the fields to just those available on pull request.
func PullRequestGraphQL(fields []string) string {
invalidFields := []string{"isPinned", "stateReason"}
s := set.NewStringSet()
s.AddValues(fields)
s.RemoveValues(invalidFields)
s.RemoveValues(issueOnlyFields)
return IssueGraphQL(s.ToSlice())
}

Expand Down
33 changes: 33 additions & 0 deletions build/macOS/distribution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<installer-gui-script minSpecVersion="2">
<title>GitHub CLI</title>
<license file="LICENSE" mime-type="text/plain"/>
<options hostArchitectures="arm64,x86_64" customize="never" require-scripts="true" allow-external-scripts="false"/>
<domains enable_localSystem="true"/>
<installation-check script="installCheck();"/>
<script>
function installCheck() {
// this check is redundant, but it produces a user friendly error message
// compared to a disabled install button caused by allowed-os-versions
if (!(system.compareVersions(system.version.ProductVersion, '12') &gt;= 0)) {
my.result.title = 'Unable to install';
my.result.message = 'GitHub CLI requires macOS 12 or later.';
my.result.type = 'Fatal';
return false;
}
return true;
}
</script>
<allowed-os-versions>
<os-version min="12.0" />
</allowed-os-versions>

<choices-outline>
<line choice="gh-cli"/>
</choices-outline>
<choice id="gh-cli" title="GitHub CLI (universal)">
<pkg-ref id="com.github.cli.pkg"/>
</choice>

<pkg-ref id="com.github.cli.pkg" auth="root">#com.github.cli.pkg</pkg-ref>
</installer-gui-script>
3 changes: 2 additions & 1 deletion cmd/gen-docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/cli/cli/v2/internal/config"
"github.com/cli/cli/v2/internal/docs"
"github.com/cli/cli/v2/internal/gh"
"github.com/cli/cli/v2/internal/ghrepo"
"github.com/cli/cli/v2/pkg/cmd/root"
"github.com/cli/cli/v2/pkg/cmdutil"
Expand Down Expand Up @@ -48,7 +49,7 @@ func run(args []string) error {
rootCmd, _ := root.NewCmdRoot(&cmdutil.Factory{
IOStreams: ios,
Browser: &browser{},
Config: func() (config.Config, error) {
Config: func() (gh.Config, error) {
return config.NewFromString(""), nil
},
ExtensionManager: &em{},
Expand Down
Loading
Loading