종속성 업데이트 자동화
예제 시나리오
프로젝트가 수많은 라이브러리 및 패키지에 의존한다고 가정해 보겠습니다. 취약하거나 오래된 종속성은 사용자의 프로젝트와 해당 프로젝트에 의존하는 다른 프로젝트에도 영향을 줄 수 있는 보안 위험을 발생시킵니다.
공동 파일럿 채팅는 Dependabot 보안 및 버전 업데이트를 설정하는 데 도움을 줄 수 있으므로, 의존성이 항상 가장 안전한 최신 버전을 유지할 수 있습니다. Dependabot 보안 업데이트 정보 및 Dependabot 버전 업데이트 정보을(를) 참조하세요.
시작하기 전에 Dependabot가 리포지토리의 "설정"에서 완전히 활성화되어 있는지 확인하세요.
- "코드 보안" 설정에서 둘 다 "사용"으로 설정되어 있는지 확인 Dependabot alerts****Dependabot security updates 합니다.
- 빈
.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.
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.
예제 출력
공동 파일럿 채팅는 리포지토리를 분석하고 Dependabot가 검사해야 하는 종속성을 알려주는 dependabot.yml 구성 파일의 내용을 작성합니다.
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 하려고 합니다.
공동 파일럿 채팅 는 팀의 요구에 더 잘 맞는 업데이트 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.
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"