{"meta":{"title":"GitHub Actions ヘルパー","intro":"GitHub Actionsワークフローを生成して改善します。","product":"GitHub Copilot","breadcrumbs":[{"href":"/ja/copilot","title":"GitHub Copilot"},{"href":"/ja/copilot/tutorials","title":"チュートリアル"},{"href":"/ja/copilot/tutorials/customization-library","title":"カスタマイズ ライブラリ"},{"href":"/ja/copilot/tutorials/customization-library/custom-instructions","title":"カスタム指示"},{"href":"/ja/copilot/tutorials/customization-library/custom-instructions/github-actions-helper","title":"GitHub Actions ヘルパー"}],"documentType":"article"},"body":"# GitHub Actions ヘルパー\n\nGitHub Actionsワークフローを生成して改善します。\n\n> \\[!NOTE]\n>\n> * このライブラリの例はインスピレーションを得るためのものです。プロジェクト、言語、チーム プロセスに合わせて具体的に調整することをお勧めします。\n> * 特定の言語とシナリオ向けのカスタム指示のコミュニティに投稿された例については、[Awesome GitHub Copilot Customizations](https://github.com/github/awesome-copilot/blob/main/docs/README.instructions.md) リポジトリを参照してください。\n> * カスタム指示は、作成するプラットフォームまたは IDE に応じて、さまざまなスコープにわたって適用できます。 詳しくは、「[GitHub Copilotの応答をカスタマイズする方法](/ja/copilot/concepts/prompting/response-customization)」を参照してください。\n\n次の例は、`actions.instructions.md` フィールドを使用して、リポジトリ内のGitHub Actionsワークフロー ファイルにのみ適用されるパス固有の`applyTo` ファイルを示しています。 パス固有の手順ファイルの詳細については、「[GitHub Copilot用のリポジトリカスタム命令の追加](/ja/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions#creating-path-specific-custom-instructions)」を参照してください。\n\n````text copy\n---\napplyTo: \".github/workflows/**/*.yml\"\n---\n\nWhen generating or improving GitHub Actions workflows:\n\n## Security First\n- Use GitHub secrets for sensitive data, never hardcode credentials\n- Pin third-party actions to specific commits by using the SHA value (e.g., `- uses: owner/some-action@a824008085750b8e136effc585c3cd6082bd575f`)\n- Configure minimal permissions for GITHUB_TOKEN required for the workflow\n\n## Performance Essentials\n- Cache dependencies with `actions/cache` or built-in cache options\n- Add `timeout-minutes` to prevent hung workflows\n- Use matrix strategies for multi-environment testing\n\n## Best Practices\n- Use descriptive names for workflows, jobs, and steps\n- Include appropriate triggers: `push`, `pull_request`, `workflow_dispatch`\n- Add `if: always()` for cleanup steps that must run regardless of failure\n\n## Example Pattern\n```yaml\nname: CI\non: [push, pull_request]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    timeout-minutes: 10\n    steps:\n      - uses: actions/checkout@v6\n      - uses: actions/setup-node@v7\n        with:\n          node-version: 20\n          cache: npm\n      - run: npm ci\n      - run: npm test\n```\n````\n\n## 参考資料\n\n* [GitHub Copilotの応答をカスタマイズする方法](/ja/copilot/concepts/prompting/response-customization) - GitHub Copilot での応答カスタマイズの概要\n* [Copilot に対してカスタム命令を追加する](/ja/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions) - カスタム指示を構成する方法\n* [優れた GitHub Copilot カスタマイズ](https://github.com/github/awesome-copilot/blob/main/README.md) - 特定の言語とシナリオ向けにコミュニティに投稿されたカスタム指示とその他のカスタマイズのリポジトリ"}