{"meta":{"title":"補助的な引数と設定","intro":"GitHub Actions Importer には、ニーズに合わせて移行プロセスを調整するためのいくつかの補足的な引数と設定があります。","product":"GitHub Actions","breadcrumbs":[{"href":"/ja/actions","title":"GitHub Actions"},{"href":"/ja/actions/reference","title":"リファレンス"},{"href":"/ja/actions/reference/github-actions-importer","title":"GitHub Actions Importer"},{"href":"/ja/actions/reference/github-actions-importer/supplemental-arguments-and-settings","title":"補助的な引数と設定"}],"documentType":"article"},"body":"# 補助的な引数と設定\n\nGitHub Actions Importer には、ニーズに合わせて移行プロセスを調整するためのいくつかの補足的な引数と設定があります。\n\nこの記事では、省略可能なパラメーター、パス引数、ネットワーク設定など、 GitHub Actions Importerの補足引数と設定を構成するための一般的な情報を提供します。\n\n## 省略可能なパラメーター\n\nGitHub Actions Importer には、移行プロセスをカスタマイズするために使用できる省略可能なパラメーターがいくつかあります。\n\n### 許可されるアクションの制限\n\n次のオプションを使うと、変換後のワークフローで許可されるアクションを制限できます。 これらのオプションを組み合わせて使うと、許可されるアクションの一覧が展開されます。 これらのオプションをいずれも指定しない場合は、すべてのアクションが許可されます。\n\n* `--allowed-actions` は、変換後のワークフローで許可するアクションの一覧を指定します。 ワイルドカードを利用できます。 指定されたもの以外のアクションは許可されません。\n\n  次に例を示します。\n\n  ```shell\n  --allowed-actions actions/checkout@v6 actions/upload-artifact@* my-org/*\n  ```\n\n  空の一覧を指定すると、すべてのアクションは許可されません。 たとえば、「 `--allowed-actions=` 」のように入力します。\n\n* `--allow-verified-actions` は、確認された作成者からのすべてのアクションが許可されることを指定します。\n\n* `--allow-github-created-actions` は、`github` または `actions` 組織から発行されたアクションが許可されることを指定します。\n\n  たとえば、`github/super-linter` と `actions/checkout` のようなアクションです。\n\n  このオプションは、`--allowed-actions actions/* github/*` と同等です。\n\n### 認証に資格情報ファイルを使う\n\n`--credentials-file` パラメーターは、認証できるさまざまなサーバーの資格情報を含むファイルへのパスGitHub Actions Importer指定します。 これは、ビルド スクリプト ( `.travis.yml` や `jenkinsfile`など) が複数の GitHub Enterprise Server インスタンスに格納されている場合に便利です。\n\n資格情報ファイルは、サーバーとアクセス トークンの組み合わせの一覧を含む YAML ファイルである必要があります。 \nGitHub Actions Importer は、作成されるネットワーク要求に最も近い URL の資格情報を使用します。\n\n次に例を示します。\n\n```yaml\n- url: https://github.com\n  access_token: ghp_mygeneraltoken\n- url: https://github.com/specific_org/\n  access_token: ghp_myorgspecifictoken\n- url: https://jenkins.org\n  access_token: abc123\n  username: marty_mcfly\n```\n\n上記の資格情報ファイルの場合、GitHub Actions Importerはアクセス トークン `ghp_mygeneraltoken`を使用して、`specific_org`組織内のリポジトリに対するネットワーク要求_がない限り_、`https://github.com`に対するすべてのネットワーク要求を認証します。 この場合、代わりに `ghp_myorgspecifictoken` トークンが認証に使われます。\n\n#### 代替ソース コード プロバイダー\n\nGitHub Actions Importer では、GitHub 以外のリポジトリからソース コードを自動的にフェッチできます。 資格情報ファイルでは、`provider`、プロバイダーの URL、ソース コードを取得するために必要な資格情報を指定できます。\n\n次に例を示します。\n\n```yaml\n- url: https://gitlab.com\n  access_token: super_secret_token\n  provider: gitlab\n```\n\n上記の例では、 GitHub Actions Importer はトークン `super_secret_token` を使用して、 `https://gitlab.com`でホストされているソース コードを取得します。\n\n`provider` でサポートされている値を次に示します。\n\n* `github` (既定値)\n* `gitlab`\n* `bitbucket_server`\n* `azure_devops`\n\n### オプション機能を制御する\n\n`--features` オプションを使用して、作成するワークフローで使用される機能GitHub Actions Importer制限できます。 これは、古いGitHub Actions インスタンスに移行するときに、ワークフローから新しいGitHub Enterprise Server構文を除外する場合に便利です。 \n`--features` オプションを使用する場合は、移行するGitHub Enterprise Serverのバージョンを指定する必要があります。\n\n次に例を示します。\n\n```shell\ngh actions-importer dry-run ... --features ghes-3.3\n```\n\n`--features` でサポートされている値を次に示します。\n\n* `all` (既定値)\n* `ghes-latest`\n* `ghes-<number>`\n`<number>`は、`3.0` 以降のGitHub Enterprise Serverのバージョンです。 たとえば、「 `ghes-3.3` 」のように入力します。\n\n`list-features` コマンドを実行してGitHub Actions Importerすると、使用可能な機能フラグの一覧を表示できます。 次に例を示します。\n\n```shell copy\ngh actions-importer list-features\n```\n\n次のような出力が表示されます。\n\n<!-- markdownlint-disable search-replace -->\n\n```shell\nAvailable feature flags:\n\nactions/cache (disabled):\n        Control usage of actions/cache inside of workflows. Outputs a comment if not enabled.\n        GitHub Enterprise Server >= ghes-3.5 required.\n\ncomposite-actions (enabled):\n        Minimizes resulting workflow complexity through the use of composite actions. See https://docs.github.com/en/actions/creating-actions/creating-a-composite-action for more information.\n        GitHub Enterprise Server >= ghes-3.4 required.\n\nreusable-workflows (disabled):\n        Avoid duplication by re-using existing workflows. See https://docs.github.com/en/actions/using-workflows/reusing-workflows for more information.\n        GitHub Enterprise Server >= ghes-3.4 required.\n\nworkflow-concurrency-option-allowed (enabled):\n        Allows the use of the `concurrency` option in workflows. See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency for more information.\n        GitHub Enterprise Server >= ghes-3.2 required.\n\nEnable features by passing --enable-features feature-1 feature-2\nDisable features by passing --disable-features feature-1 feature-2\n```\n\n<!-- markdownlint-enable search-replace -->\n\n機能フラグを切り替えるには、次のいずれかの方法を使うことができます。\n* `--enable-features` コマンドを実行するときに、`--disable-features` オプションと `gh actions-importer` オプションを使います。\n* 各機能フラグに環境変数を使います。\n\n`--enable-features` オプションと `--disable-features` オプションを使って、コマンドの期間を有効または無効にする特定の機能を選ぶことができます。\nたとえば、次のコマンドを使うと、`actions/cache` と `composite-actions` の使用が無効になります。\n\n```shell\ngh actions-importer dry-run ... --disable-features=composite-actions actions/cache\n```\n\n`configure --features` コマンドを使って、機能フラグを対話形式で構成し、環境に自動的に書き込むことができます。\n\n```shell\n$ gh actions-importer configure --features\n\n✔ Which features would you like to configure?: actions/cache, reusable-workflows\n✔ actions/cache (disabled): Enable\n? reusable-workflows (disabled):\n› Enable\n  Disable\n```\n\n### ネットワーク応答キャッシュの無効化\n\n既定では、 GitHub Actions Importer はネットワーク要求からの応答をキャッシュして、ネットワーク負荷を軽減し、実行時間を短縮します。 \n`--no-http-cache` オプションを使うと、ネットワーク キャッシュを無効にできます。 次に例を示します。\n\n```shell\ngh actions-importer forecast ... --no-http-cache\n```\n\n## パス引数\n\nGitHub Actions Importerを実行する場合、パス引数はコンテナーのディスクに対して相対的であるため、コンテナーのホスト コンピューターに対する絶対パスはサポートされません。 \nGitHub Actions Importerを実行すると、コンテナーの `/data` ディレクトリが、GitHub Actions Importerが実行されるディレクトリにマウントされます。\n\nたとえば、次のコマンドは、 `/Users/mona` ディレクトリで使用すると、 GitHub Actions Importer 監査の概要を `/Users/mona/out` ディレクトリに出力します。\n\n```shell\ngh actions-importer audit --output-dir /data/out\n```\n\n## プロキシの使用\n\nHTTP プロキシで構成されているサーバーにアクセスするには、プロキシの URL で次の環境変数を設定する必要があります。\n\n* `OCTOKIT_PROXY`: 任意の GitHub サーバーの場合。\n* `HTTP_PROXY` (または `HTTPS_PROXY`): 他のサーバーの場合。\n\n次に例を示します。\n\n```shell\nexport OCTOKIT_PROXY=https://proxy.example.com:8443\nexport HTTPS_PROXY=$OCTOKIT_PROXY\n```\n\nプロキシで認証が必要な場合は、プロキシの URL にユーザー名とパスワードを含める必要があります。 たとえば、「 `https://username:password@proxy.url:port` 」のように入力します。\n\n## SSL 証明書の検証の無効化\n\n既定では、 GitHub Actions Importer はネットワーク要求を行うときに SSL 証明書を検証します。 \n`--no-ssl-verify` オプションで SSL 証明書の検証を無効にできます。 次に例を示します。\n\n```shell\ngh actions-importer audit --output-dir ./output --no-ssl-verify\n```\n\n## 法務上の通知\n\nMIT ライセンスのもとで https://github.com/github/gh-actions-importer/ から一部を引用しています。\n\n```text\nMIT License\n\nCopyright (c) 2022 GitHub\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```"}