Skip to main content

Dependabot 보안 업데이트에 대한 끌어오기 요청 사용자 지정

프로젝트의 보안 우선순위 및 워크플로에 맞춰 Dependabot의 풀 리퀘스트에 대한 보안 업데이트를 사용자 지정하는 방법을 알아봅니다.

누가 이 기능을 사용할 수 있나요?

Users with write access

끌어오기 요청 사용자 지정 준비

리포지토리에 대한 dependabot.yml 파일을 아직 구성하지 않았고 보안 업데이트에 대한 풀 리퀘스트를 사용자 정의하려면 먼저 다음 단계를 수행해야 합니다.

  1. 리포지토리의 dependabot.yml 디렉터리에 .github 파일을 체크인합니다. 자세한 내용은 Dependabot 버전 업데이트 구성을(를) 참조하세요.
  2. 필요한 모든 키들을 설정합니다. 자세한 내용은 필수 키를 참조하세요.
  3. 패키지 에코시스템에 대한 사용자 정의를 보안 업데이트에만 적용하고 버전 업데이트는 제외하려면 open-pull-requests-limit 키를 0로 설정하세요.

그런 다음 보안 업데이트 필요성과 우선순위를 고려한 후, 아래에 설명된 사용자 지정 옵션들을 조합하여 적용할 수 있습니다.

의미 있는 업데이트 우선 순위 지정

의미 있는 업데이트를 우선적으로 처리하는 대상 검토 프로세스 를 구축하기 위해, groups 을 사용하여 여러 종속성에 대한 보안 업데이트를 단일 풀 리퀘스트로 통합합니다.

자세한 지침은 의미 있는 업데이트 우선 순위 지정을 참조하세요.

검토자 및 담당자 자동 추가

중요

          `reviewers` 속성이 중단되고 향후 GitHub Enterprise Server 릴리스에서 제거될 예정입니다.

CODEOWNERS 파일을 사용하여 검토자 및 담당자를 자동으로 추가할 수도 있습니다. 코드 소유자 정보을(를) 참조하세요.

프로젝트의 보안 업데이트가 적절한 팀에 의해 적시에 처리되도록 하려면 reviewersassignees을(를) 사용하여 개인이나 팀을 끌어오기 요청에 검토자 또는 담당자로 자동으로 추가합니다.

자세한 지침은 검토자 및 담당자 자동 추가를 참조하세요.

사용자 지정 레이블을 사용하여 풀 리퀘스트에 레이블을 지정합니다.

특정 풀 리퀘스트의 우선순위 를 정하거나 CI/CD 파이프라인에 통합하려면 labels 을 사용하여 각 풀 리퀘스트에 고유한 사용자 지정 레이블 을 적용하세요.

자세한 지침은 사용자 지정 레이블로 끌어오기 요청 레이블 지정을 참조하세요.

메시지를 커밋하는 접두사 추가

커밋 메시지나 풀 리퀘스트 제목을 처리하는 자동화 및 통합 을 위해 commit-message 을 사용하여 커밋 메시지와 풀 리퀘스트 제목에 사용할 접두사를 지정합니다.

자세한 지침은 커밋 메시지에 접두사 추가를 참조하세요.

끌어오기 요청을 마일스톤과 연결

프로젝트 목표나 릴리스 진행 상황을 추적하려면milestone을 사용하여 Dependabot의 끌어오기 요청을 마일스톤에 연결하세요.

자세한 지침은 마일스톤과 끌어오기 요청 연결을 참조하세요.

풀 리퀘스트 분기 이름의 구분 기호 변경

팀의 기존 규칙에 맞춰 분기 이름을 설정하려면 pull-request-branch-name.separator 을 사용하여 Dependabot에서 분기 이름에 사용할 구분 기호를 지정하세요.

자세한 지침은 끌어오기 요청 분기 이름의 구분 기호 변경을 참조하세요.

예제 1: 보안 업데이트에 대한 구성만

이 예제에서 dependabot.yml 파일은 다음과 같습니다.

  • npm 종속성 업데이트 시, 프라이빗 레지스트리를 활용합니다.
  • 모든 사용자 정의 설정이 보안 업데이트에만 적용되도록 종속성 버전 업데이트를 비활성화합니다.
  • Dependabot을 사용자 지정하여 끌어오기 요청에 사용자 지정 레이블을 적용하고 검토자 및 담당자를 자동으로 추가할 수 있습니다.
  • Golang 종속성에 대한 보안 업데이트를 단일 끌어오기 요청으로 그룹화합니다.
YAML
# Example configuration file that:
#  - Uses a private registry for npm updates
#  - Ignores lodash dependency
#  - Disables version-updates
#  - Applies custom labels
#  - Adds assignees
#  - Group security updates for golang dependencies into a single pull request

version: 2
registries:
  # Define a private npm registry with the name `example`
  example:
    type: npm-registry
    url: https://example.com
    token: ${{secrets.NPM_TOKEN}}
updates:
  - package-ecosystem: "npm"
    directory: "/src/npm-project"
    schedule:
      interval: "daily"
    # For Lodash, ignore all updates
    ignore:
      - dependency-name: "lodash"
    # Disable version updates for npm dependencies
    open-pull-requests-limit: 0
    registries:
      # Ask Dependabot to use the private registry for npm
      - example
    # Raise all npm pull requests for security updates with custom labels
    labels:
      - "npm dependencies"
      - "triage-board"
    # Raise all npm pull requests for security updates with assignees
    assignees:
      - "user-name"
  - package-ecosystem: "gomod"
    groups:
      # Group security updates for golang dependencies
      # into a single pull request
      golang:
        applies-to: security-updates
        patterns:
          - "golang.org*"

예제 2: 버전 업데이트 및 보안 업데이트 구성

이 예제에서 dependabot.yml 파일은 다음과 같습니다.

  • Dependabot이 버전 업데이트와 보안 업데이트 모두에 사용자 지정 레이블을 추가하도록 사용자 지정됩니다.
  •         `groups` 사용자 지정 옵션을 사용하여 여러 업데이트를 단일 끌어오기 요청으로 그룹화하기 위해 두 개의 그룹("`angular`" 및 "`production-dependencies`")을(를) 만듭니다.
    
  •         `groups`에 대한 `angular` 사용자 정의 설정이 보안 업데이트에만 적용되도록 지정합니다.
    
  •         `groups`에 대한 `production-dependencies` 사용자 정의 설정이 버전 업데이트에만 적용되도록 지정합니다.
    
YAML
version: 2
updates:
  # Keep npm dependencies up to date
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
# Raise all npm pull requests for security and version updates with custom labels
    labels:
      - "npm dependencies"
      - "triage-board"
    groups:
      angular:
        # Group security updates for Angular dependencies into a single pull request
        applies-to: security-updates
        patterns:
          - "@angular*"
      production-dependencies:
        # Group version updates for dependencies of type "production" into a single pull request
        applies-to: version-updates
        dependency-type: "production"

추가 읽기

  •         [AUTOTITLE](/code-security/dependabot/working-with-dependabot/dependabot-options-reference)
    
  •         [AUTOTITLE](/code-security/dependabot/working-with-dependabot/configuring-access-to-private-registries-for-dependabot)