Closed9
GitHub CLIを使ってActionsでIssueとProjectの連携
LinkしたプロジェクトにIssueが自動で乗って欲しい、とかあるけど、変にAction作り込まんでもGitHub CLI使ってさらっとやれるんじゃないかなという試み
いつものtoyboxリポジトリでやってみる
go製なのにgo getで使えないんかgithub cli。何を考えているんだろう。
仕方がないので素直にインストールしてみる
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
Release GitHub CLI 1.2.1 · cli/cli
私は、debの人なのでパッケージでいいっぽい?
Run apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
Executing: /tmp/apt-key-gpghome.T9JylUQn3W/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: key C99B11DEB97541F0: public key "Nate Smith <vilmibm@github.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: key 4D64390375060AA4: 1 signature not checked due to a missing key
gpg: failed to create temporary file '/etc/apt/trusted.gpg.d/.#lk0x000055ea5ccda010.fv-az184-108.2659': Permission denied
gpg: can't allocate lock for '/etc/apt/trusted.gpg.d/apt.postgresql.org.gpg'
gpg: key 4D64390375060AA4: public key not found: General error
gpg: error reading '[stdin]': General error
gpg: import from '[stdin]' failed: General error
gpg: Total number processed: 0
Error: Process completed with exit code 1.
駄目。なんかkeyが古いっぽいな。
良いや。Releasesから持ってくる。
ちなみにgo getは不可。
go get github.com/cli/cli/cmd/gh
# github.com/cli/cli/api
Error: ../../../go/src/github.com/cli/cli/api/queries_issue.go:416:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_issue.go:441:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_org.go:34:13: gql.QueryNamed undefined (type *graphql.Client has no field or method QueryNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_org.go:78:13: gql.QueryNamed undefined (type *graphql.Client has no field or method QueryNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:271:10: v4.QueryNamed undefined (type *graphql.Client has no field or method QueryNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:884:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:1071:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:1092:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:1129:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:1150:12: gql.MutateNamed undefined (type *graphql.Client has no field or method MutateNamed)
Error: ../../../go/src/github.com/cli/cli/api/queries_pr.go:1150:12: too many errors
Error: Process completed with exit code 2.
プロジェクトが腐り始めてるニオイがする。
とかをおとなしく使っておくのが吉だな
issue: https://github.com/kyoh86-tryouts/test/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
workflow: https://github.com/kyoh86-tryouts/test/blob/master/.github/workflows/project-link.yaml
project: https://github.com/kyoh86-tryouts/test/projects/1
できた
repository projectじゃなくてorganization base projectの場合はちょっとやり方が違うみたいだけど
(別途Private Access Tokenが要る)このスクラップは2020/11/23にクローズされました