【Github】Github の 各種設定 ~ Actions ~

■ はじめに

https://dk521123.hatenablog.com/entry/2024/07/11/131849

の続き。

今回は、Github Actions の設定について調べてみた

目次

【1】Actions の許可制限
【2】Artifactとログの保持期間
【3】外部コラボレータのアクセス許可
【4】ワークフロー許可
 1)プルリクに関して

【1】Actionの許可範囲

* Actionの許可範囲(Actions permissions)は、以下の通り。

[1] Allow all actions and reusable workflows
[2] Disable actions
[3] Allow <YourGithubUser> actions and reusable workflows
[4] Allow <YourGithubUser>, and select non-<YourGithubUser>, actions and reusable workflows

https://docs.github.com/ja/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-select-actions-and-reusable-workflows-to-run

[1] Allow all actions and reusable workflows

* アクションと再利用可能なワークフローを全て許可
* Default

[2] Disable actions

* アクションをOFF

[3] Allow actions and reusable workflows

* 自分のアクションと再利用可能なワークフローを許可
  • [4] Allow , and select non-, actions and reusable workflows **
* 自分と自分以外のアクションと再利用可能なワークフローを許可

【2】Artifactとログの保持期間

* Artifact and log retention = Artifact とログの保持期間
* 90 days が  Default
* 1 ~ 90 days(パブリックリポジトリの場合)
* 1 ~ 400 days(プライベートリポジトリの場合)

https://docs.github.com/ja/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy

【3】外部コラボレータのアクセス許可

* Fork pull request workflows from outside collaborators
=> 外部コラボレーターからのプルリクエストワークフロー
 をフォークする際の設定。

* 以下を参照。
[1] Require approval for first-time contributors who are new to GitHub
[2] Require approval for first-time contributors
[3] Require approval for all outside collaborators

https://docs.github.com/ja/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks

[1] Require approval for first-time contributors who are new to GitHub

* GitHubへの初めてのコントリビューターには承認が必要

[2] Require approval for first-time contributors

* 初めてのコントリビューターには承認が必要

[3] Require approval for all outside collaborators

* 全ての外部コントリビューターには承認が必要

【4】ワークフロー許可

* Workflow permissions = ワークフロー許可

https://docs.github.com/ja/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token

[1] Read and write permissions

* 読み込み&書き込みの許可

[2] Read repository contents and packages permissions

* リポジトリの内容の読み込みとパッケージ許可

1)プルリクに関して

* Allow GitHub Actions to create and approve pull requests
 = GitHub Actionsでプルリクエストの作成と承認を許可するかどうか

関連記事

Github ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2019/07/18/234652
Github の 各種設定 ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2024/07/11/131849
Github の 各種設定 ~ Actions ~
https://dk521123.hatenablog.com/entry/2024/07/13/163010
Github Actions ~ 基礎知識編 ~
https://dk521123.hatenablog.com/entry/2021/11/04/142835
Github Actions ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2022/06/16/151443
Github Actions ~ 基本編 ~
https://dk521123.hatenablog.com/entry/2023/12/22/195715
Github Custom Action ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2024/06/27/220219
Github Actions ~ runs-onを動的変更することを考える ~
https://dk521123.hatenablog.com/entry/2024/05/18/032229