이 경고에 관한 정보
Warning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer
necessary. Please remove this step as Code Scanning recommends analyzing the merge
commit for best results.
이전 CodeQL 워크플로를 사용하는 경우 "초기화 CodeQL" 작업에서 이 경고를 받을 수 있습니다.
문제의 원인 확인
워크플로에서 다음 줄을 확인합니다 CodeQL . 이러한 줄은 CodeQL 워크플로의 초기 버전의 Analyze 작업 섹션에 steps 포함되었습니다.
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
문제 해결
CodeQL 워크플로에서 줄을 제거합니다. 워크플로의 수정된 `steps` 섹션은 다음과 같아야 합니다.
steps:
- name: Checkout repository
uses: actions/checkout@v5
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
# ...