LoginSignup
11
4

More than 5 years have passed since last update.

タスクの自動化をするためのGitHubアカウント(machine user)

Posted at

以前、RedmineとGitHubを連携させたとき、最初はdeploy keyを使っていたのですが、複数リポジトリを扱うために、それらにアクセスできるアカウントに紐付けたSSH keyを使う形に変更しました。

複数アカウントを持つのはどうなのという話題もあって、アカウントの利用規約 を見ていたら、上記のようなケースについての説明が見つかりました。

以下は説明文の抜粋です。

Machine users

If your server needs to access multiple repositories, you can choose to create a new GitHub account and attach an SSH key that will be used exclusively for automation. Since this GitHub account won't be used by a human, it's called a machine user. You can then add the machine user as collaborator or add the machine user to a team with access to the repositories it needs to manipulate. NOTE: Adding a machine user as a collaborator always grants read/write access. Adding a machine user to a team grants the permissions of the team.

Redmineと連携させるには、Redmineサーバ上に、リポジトリのミラーをつくるようなものなので、webhookで自動でgit pullするためのアカウントが必要なので、そのものずばりですね。

それでは、がんがんこういうアカウントを作っていいかというと、そうでもなさそうです。

直ぐ後にあるtipsで釘をさされています。botなどで、自動的にアカウントを作るのはだめということです。

Tip: Our terms of service state:

Accounts registered by "bots" or other automated methods are not permitted.

This means that you cannot automate the creation of accounts. But if you want to create a single machine user for automating tasks such as deploy scripts in your project or organization, that is totally cool.

また、アカウント利用規約では、machine userはひとつまでと書いてあります。

One person or legal entity may not maintain more than one free account, and one machine user account that is used exclusively for performing automated tasks.

何かの自動化のためであれば、サーバ毎にSSH keyを用意すれば、そのためのアカウントがひとつあれば事足りるので、そういうものかなという気がします。

11
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
4