종속성 업데이트 자동화
예제 시나리오
프로젝트가 수많은 라이브러리 및 패키지에 의존한다고 가정해 보겠습니다. 취약하거나 오래된 종속성은 사용자의 프로젝트와 해당 프로젝트에 의존하는 다른 프로젝트에도 영향을 줄 수 있는 보안 위험을 발생시킵니다.
Copilot Chat을 사용하면 Dependabot 보안 및 버전 업데이트를 설정하는 데 도움이 되므로 종속성이 항상 가장 안전하고 최신 버전으로 유지됩니다. Dependabot 보안 업데이트 정보 및 Dependabot 버전 업데이트 정보을(를) 참조하세요.
시작하기 전에 리포지토리의 "Settings"에서 Dependabot이 완전히 활성화되어 있는지 확인하세요.
- "Code security" 설정에서 Dependabot alerts 및 Dependabot security updates 가 모두 "Enabled"로 설정되어 있는지 확인하세요.
- 빈
.github/dependabot.yml
파일을 만들고 리포지토리에 커밋합니다.
예시 프롬프트
리포지토리가 컨텍스트의 프롬프트에 연결되어 있는지 확인합니다.
Analyze the codebase and project structure of this repository. Detect all package managers and package ecosystems in use, including their respective locations (e.g., npm, yarn, pip, maven, gradle, composer, github-actions, etc.).
For each detected ecosystem, create a configuration entry in a single, top-level .github/dependabot.yml file that enables security and version updates on a reasonable schedule. Use the recommended best practices for each ecosystem. Clearly specify the directory for each ecosystem detected. If multiple ecosystems or multiple directories are present, include them all in the configuration.
In the output, include any notes on the configuration or best practices, as well as next steps that include how to commit the dependabot.yml file to the repository via the GitHub web browser and how to check that Dependabot version updates and Dependabot security updates are enabled.
예제 출력
Copilot Chat은 리포지토리를 분석하고 dependabot.yml
구성 파일의 내용을 작성하여 Dependabot이 어떤 종속성을 검사해야 하는지 알려줍니다.
version: 2
updates:
# Python (pip)
- package-ecosystem: "pip"
directory: "/" # Location of requirements.txt
schedule:
interval: "weekly" # Weekly updates are a good balance for libraries
day: "sunday"
time: "06:00"
timezone: "UTC"
open-pull-requests-limit: 5
allow:
- dependency-type: "all"
commit-message:
prefix: "pip"
labels:
- "dependencies"
- "python"
ignore:
- dependency-name: "pip" # Ignore pip self-updates
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/" # Looks for workflow files under .github/workflows/
schedule:
interval: "weekly"
day: "sunday"
time: "06:00"
timezone: "UTC"
open-pull-requests-limit: 5
commit-message:
prefix: "actions"
labels:
- "dependencies"
- "github-actions"
dependabot.yml
파일을 리포지토리에 커밋하면 취약하거나 오래된 종속성이 감지될 때마다 Dependabot이 리포지토리에 대한 끌어오기 요청을 열기 시작합니다.
종속성 관리 사용자 지정
예제 시나리오
예제 시나리오
팀에서 몇 달 동안 기본 Dependabot 구성을 사용해 왔고, 종속성 업데이트 끌어오기 요청을 많이 받고 있다고 가정해 보겠습니다. 그런데 다음과 같은 문제들이 발생하고 있습니다.
- 끌어오기 요청은 자동으로 검토자가 할당되지 않으므로 검토되지 않은 채 방치되고 있습니다.
- 끌어오기 요청이 레이블을 통해 팀의 프로젝트 보드에 자동으로 추가되도록 하고 싶습니다.
- 동시에 너무 많은 종속성 끌어오기 요청으로 인해 CI에 과부하가 발생하고 있습니다.
- 프로덕션에 영향을 주지 않는 개발 종속성에 대한 업데이트를 받고 있습니다.
Dependabot 구성을 사용자 지정하여 팀의 워크플로에 더 잘 맞도록 하세요. 예를 들어, 끌어오기 요청을 적합한 팀원에게 자동으로 할당하고, 프로젝트 보드에 끌어오기 요청을 추가할 때 라벨을 추가하고, 열려 있는 끌어오기 요청 수를 제한하고, 프로덕션 종속성에만 집중하는 등의 작업이 필요합니다.
Copilot Chat은 팀의 요구 사항에 더 잘 맞게 업데이트된 dependabot.yml
을 작성할 수 있습니다.
예시 프롬프트
I want to customize my pull requests for Dependabot security and version updates, so that:
* Pull requests are automatically assigned to the team "octocat-reviewers."
* The label "security-management" is automatically added to every pull request.
* The number of open Dependabot PRs is limited.
* Development dependencies are ignored.
Draft an update to the dependabot.yml file in my repository that specifies these customization options.
팁
- 탐색할 수 있는 많은 사용자 지정 옵션이 있습니다. 자세한 내용은 Dependabot 보안 업데이트에 대한 끌어오기 요청 사용자 지정 및 프로세스에 맞게 Dependabot 끌어오기 요청 사용자 지정을(를) 참조하세요.
- 패키지 에코시스템별로 다양한 사용자 지정을 지정할 수 있습니다.
예제 출력
version: 2
updates:
# Python (pip)
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "06:00"
timezone: "UTC"
open-pull-requests-limit: 5
allow:
- dependency-type: "production" # Ignore development dependencies
assignees:
- "octocat-reviewers" # Assign PRs to the team
labels:
- "dependencies"
- "security-management" # Custom label for all PRs
- "python"
commit-message:
prefix: "pip"
ignore:
- dependency-name: "pip"