참고
- 이 라이브러리의 예시는 영감을 얻기 위한 것입니다. 프로젝트, 언어, 팀 프로세스에 더 구체적으로 맞게 조정하는 것이 좋습니다.
- 특정 언어 및 시나리오에 대한 사용자 지정 지침의 커뮤니티 기여 예시는 우수한 GitHub Copilot 사용자 지정 리포지토리를 참조하세요.
- 사용자 지정 지침을 만드는 플랫폼 또는 IDE에 따라 다양한 범위에서 사용자 지정 지침을 적용할 수 있습니다. 자세한 내용은 "GitHub Copilot 응답을 사용자 지정하는 방법에 대한 정보"을(를) 참조하세요.
다음 예제는 applyTo 필드를 사용하여 리포지토리의 GitHub Actions 워크플로 파일에만 적용되는 경로별 actions.instructions.md 파일을 보여 줍니다. 경로 특정 지침 파일에 대한 자세한 내용은 GitHub Copilot 대한 리포지토리 사용자 지정 지침 추가을(를) 참조하세요.
---
applyTo: ".github/workflows/**/*.yml"
---
When generating or improving GitHub Actions workflows:
## Security First
- Use GitHub secrets for sensitive data, never hardcode credentials
- Pin third-party actions to specific commits by using the SHA value (e.g., `- uses: owner/some-action@a824008085750b8e136effc585c3cd6082bd575f`)
- Configure minimal permissions for GITHUB_TOKEN required for the workflow
## Performance Essentials
- Cache dependencies with `actions/cache` or built-in cache options
- Add `timeout-minutes` to prevent hung workflows
- Use matrix strategies for multi-environment testing
## Best Practices
- Use descriptive names for workflows, jobs, and steps
- Include appropriate triggers: `push`, `pull_request`, `workflow_dispatch`
- Add `if: always()` for cleanup steps that must run regardless of failure
## Example Pattern
```yaml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm test
```
---
applyTo: ".github/workflows/**/*.yml"
---
When generating or improving GitHub Actions workflows:
## Security First
- Use GitHub secrets for sensitive data, never hardcode credentials
- Pin third-party actions to specific commits by using the SHA value (e.g., `- uses: owner/some-action@a824008085750b8e136effc585c3cd6082bd575f`)
- Configure minimal permissions for GITHUB_TOKEN required for the workflow
## Performance Essentials
- Cache dependencies with `actions/cache` or built-in cache options
- Add `timeout-minutes` to prevent hung workflows
- Use matrix strategies for multi-environment testing
## Best Practices
- Use descriptive names for workflows, jobs, and steps
- Include appropriate triggers: `push`, `pull_request`, `workflow_dispatch`
- Add `if: always()` for cleanup steps that must run regardless of failure
## Example Pattern
```yaml
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm test
```
추가 참고 자료
- GitHub Copilot 응답을 사용자 지정하는 방법에 대한 정보 - GitHub Copilot의 응답 사용자 지정 개요
- 에 대한 사용자 지정 지침 추가 Copilot - 사용자 지정 지침을 구성하는 방법
- 멋진 GitHub Copilot 사용자 지정 - 특정 언어 및 시나리오의 커뮤니티 기여 사용자 지정 지침 및 기타 사용자 지정 리포지토리