{"meta":{"title":"경고: \"이 워크플로에서 1개의 문제가 감지되었습니다. git 검사 HEAD^2가 더 이상 필요하지 않습니다.\"","intro":"이 경고가 표시되는 경우 현재 모범 사례를 따르도록 워크플로를 업데이트해야 합니다.","product":"보안 및 코드 품질","breadcrumbs":[{"href":"/ko/code-security","title":"보안 및 코드 품질"},{"href":"/ko/code-security/reference","title":"Reference"},{"href":"/ko/code-security/reference/code-scanning","title":"코드 검사"},{"href":"/ko/code-security/reference/code-scanning/troubleshoot-analysis-errors","title":"분석 오류 문제 해결"},{"href":"/ko/code-security/reference/code-scanning/troubleshoot-analysis-errors/unnecessary-step-found","title":"불필요한 단계가 발견되었습니다."}],"documentType":"article"},"body":"# 경고: \"이 워크플로에서 1개의 문제가 감지되었습니다. git 검사 HEAD^2가 더 이상 필요하지 않습니다.\"\n\n이 경고가 표시되는 경우 현재 모범 사례를 따르도록 워크플로를 업데이트해야 합니다.\n\n## 이 경고에 관한 정보\n\n```text\nWarning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer\nnecessary. Please remove this step as Code Scanning recommends analyzing the merge\ncommit for best results.\n```\n\n이전 CodeQL 워크플로를 사용하는 경우 \"초기화 CodeQL\" 작업에서 이 경고를 받을 수 있습니다.\n\n## 문제의 원인 확인\n\n워크플로에서 다음 줄을 확인합니다 CodeQL . 이러한 줄은 CodeQL 워크플로의 초기 버전의 `Analyze` 작업 섹션에 `steps` 포함되었습니다.\n\n```yaml\n        with:\n          # We must fetch at least the immediate parents so that if this is\n          # a pull request then we can checkout the head.\n          fetch-depth: 2\n\n      # If this run was triggered by a pull request event, then checkout\n      # the head of the pull request instead of the merge commit.\n      - run: git checkout HEAD^2\n        if: ${{ github.event_name == 'pull_request' }}\n```\n\n## 문제 해결\n\nCodeQL 워크플로에서 줄을 제거합니다. 워크플로의 수정된 `steps` 섹션은 다음과 같아야 합니다.\n\n```yaml\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n\n      # Initializes the CodeQL tools for scanning.\n      - name: Initialize CodeQL\n        uses: github/codeql-action/init@v4\n\n      # ...\n```"}