Skip to main content

추가 인수 및 설정

GitHub Actions Importer에는 요구 사항에 따라 마이그레이션 프로세스를 조정하는 몇 가지 추가 인수 및 설정이 있습니다.

법적 고지

이 문서는 GitHub Actions Importer의 추가 인수 및 설정(예: 선택적 매개 변수, 경로 인수 및 네트워크 설정)을 구성하는 일반적인 정보를 포함하고 있습니다.

선택적 매개 변수

GitHub Actions Importer에는 마이그레이션 프로세스를 사용자 지정하는 데 사용할 수 있는 몇 가지 선택적 매개 변수가 있습니다.

허용되는 작업 제한하기

다음 옵션을 사용하여 변환된 워크플로에서 허용되는 작업을 제한할 수 있습니다. 이러한 옵션을 함께 사용하면 허용된 작업 목록이 확장됩니다. 이러한 옵션을 제공하지 않으면 모든 작업이 허용됩니다.

  • --allowed-actions이(가) 변환된 워크플로에서 허용할 작업 목록을 지정합니다. 와일드카드가 지원됩니다. 제공된 작업 이외의 다른 작업은 허용되지 않습니다.

    예시:

    --allowed-actions actions/checkout@v4 actions/upload-artifact@* my-org/*
    

    빈 목록을 제공하여 모든 작업이 허용되지 않도록 할 수 있습니다. 예: --allowed-actions=.

  • --allow-verified-actions은(는) 확인된 작성자의 모든 작업이 허용되도록 지정합니다.

  • --allow-github-created-actions은(는) github 또는 actions 조직에서 게시한 작업이 허용되도록 지정합니다.

    예를 들어 이러한 작업에는 github/super-linteractions/checkout 같은 작업이 포함됩니다.

    이 옵션은 --allowed-actions actions/* github/*을(를) 실행하는 것과 동일합니다.

인증에 자격 증명 파일 사용하기

--credentials-file 매개 변수는 GitHub Actions Importer에서 인증할 수 있는 여러 서버의 자격 증명이 포함된 파일의 경로를 지정합니다. 이는 빌드 스크립트(예: .travis.yml 또는 jenkinsfile)가 여러 GitHub Enterprise Server 인스턴스에 저장될 때 유용합니다.

자격 증명 파일은 서버 목록과 액세스 토큰 조합이 포함된 YAML 파일이어야 합니다. GitHub Actions Importer은(는) 만드는 네트워크 요청과 가장 밀접하게 일치하는 URL에 대한 자격 증명을 사용합니다.

예시:

- url: https://github.com
  access_token: ghp_mygeneraltoken
- url: https://github.com/specific_org/
  access_token: ghp_myorgspecifictoken
- url: https://jenkins.org
  access_token: abc123
  username: marty_mcfly

위의 자격 증명 파일의 경우, 네트워크 요청이 specific_org 조직의 리포지토리에 대한 것이 아닌 한 GitHub Actions Importer은(는) 액세스 토큰 ghp_mygeneraltoken을(를) 사용하여 모든 네트워크 요청을 https://github.com에 인증합니다. 이 경우 ghp_myorgspecifictoken 토큰이 대신 인증에 사용됩니다.

대체 소스 제어 공급자

GitHub Actions Importer은(는) 비 GitHub 리포지토리에서 소스 코드를 자동으로 가져올 수 있습니다. 자격 증명 파일은 소스 코드를 검색하는 데 필요한 provider, 공급자 URL 및 자격 증명을 지정할 수 있습니다.

예시:

- url: https://gitlab.com
  access_token: super_secret_token
  provider: gitlab

위의 예시에서 GitHub Actions Importer은(는) 토큰을 사용하여 super_secret_token 호스트되는 소스 코드를 검색합니다https://gitlab.com.

provider에 대해 지원되는 값은 다음과 같습니다.

  • github (기본값)
  • gitlab
  • bitbucket_server
  • azure_devops

선택적 기능 제어하기

--features 옵션을 사용하여 GitHub Actions Importer에서 만드는 워크플로에 사용되는 기능을 제한할 수 있습니다. 이는 이전 GitHub Enterprise Server 인스턴스로 마이그레이션할 때 워크플로에서 최신 GitHub Actions 구문을 제외하는 데 유용합니다. --features 옵션을 사용하는 경우 마이그레이션할 GitHub Enterprise Server의 버전을 지정해야 합니다.

예시:

gh actions-importer dry-run ... --features ghes-3.3

--features에 대해 지원되는 값은 다음과 같습니다.

  • all(기본값)
  • ghes-latest
  • ghes-<number>, <number>가 GitHub Enterprise Server, 3.0 또는 그 이후 버전인 경우. 예: ghes-3.3.

list-features 명령을 실행하여 GitHub Actions Importer에서 사용 가능한 기능 플래그 목록을 볼 수 있습니다. 예시:

Shell
gh actions-importer list-features

다음과 유사한 결과가 표시됩니다.

Available feature flags:

actions/cache (disabled):
        Control usage of actions/cache inside of workflows. Outputs a comment if not enabled.
        GitHub Enterprise Server >= ghes-3.5 required.

composite-actions (enabled):
        Minimizes resulting workflow complexity through the use of composite actions. See https://docs.github.com/en/actions/creating-actions/creating-a-composite-action for more information.
        GitHub Enterprise Server >= ghes-3.4 required.

reusable-workflows (disabled):
        Avoid duplication by re-using existing workflows. See https://docs.github.com/en/actions/using-workflows/reusing-workflows for more information.
        GitHub Enterprise Server >= ghes-3.4 required.

workflow-concurrency-option-allowed (enabled):
        Allows the use of the `concurrency` option in workflows. See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency for more information.
        GitHub Enterprise Server >= ghes-3.2 required.

Enable features by passing --enable-features feature-1 feature-2
Disable features by passing --disable-features feature-1 feature-2

기능 플래그를 토글하려면 다음 방법 중 하나를 사용할 수 있습니다.

  • --enable-features--disable-features 옵션을 사용해 gh actions-importer 명령을 실행합니다.
  • 각 기능 플래그에 환경 변수를 사용합니다.

--enable-features--disable-features 옵션을 사용해 명령 기간 동안 특정 기능을 사용하거나 사용하지 않도록 선택할 수 있습니다. 예를 들어 다음 명령은 actions/cachecomposite-actions을(를) 사용 중지합니다.

gh actions-importer dry-run ... --disable-features=composite-actions actions/cache

configure --features 명령을 사용하여 기능 플래그를 대화형으로 구성하고 사용자 환경에 자동으로 쓸 수 있습니다.

$ gh actions-importer configure --features

✔ Which features would you like to configure?: actions/cache, reusable-workflows
✔ actions/cache (disabled): Enable
? reusable-workflows (disabled):
› Enable
  Disable

네트워크 응답 캐싱을 사용 중지하기

기본적으로 GitHub Actions Importer은(는) 네트워크 요청의 응답을 캐시하여 네트워크 부하를 줄이고 런타임을 줄입니다. --no-http-cache 옵션을 사용하여 네트워크 캐시를 사용 중지할 수 있습니다. 예시:

gh actions-importer forecast ... --no-http-cache

경로 인수

GitHub Actions Importer을(를) 실행할 때 경로 인수는 컨테이너 디스크를 기준으로 하므로, 컨테이너의 호스트 컴퓨터에 대해 상대적인 절대 경로는 지원되지 않습니다. GitHub Actions Importer이(가) 실행되면 컨테이너의 /data 디렉터리가 GitHub Actions Importer이(가) 실행되는 디렉터리에 탑재됩니다.

예를 들어 다음 명령은 /Users/mona 디렉터리에 사용되는 경우 GitHub Actions Importer 감사 요약을 /Users/mona/out 디렉터리에 출력합니다.

gh actions-importer audit --output-dir /data/out

프록시 사용하기

HTTP 프록시로 구성된 서버에 액세스하려면 프록시의 URL을 사용하여 다음 환경 변수를 설정해야 합니다.

  • OCTOKIT_PROXY: 모든 GitHub 서버의 경우
  • HTTP_PROXY(또는 HTTPS_PROXY): 다른 서버의 경우.

예시:

export OCTOKIT_PROXY=https://proxy.example.com:8443
export HTTPS_PROXY=$OCTOKIT_PROXY

프록시에 인증이 필요한 경우 사용자 이름과 암호가 프록시 URL에 포함되어야 합니다. 예: https://username:password@proxy.url:port.

SSL 인증서 확인 사용 중지하기

기본적으로 GitHub Actions Importer은(는) 네트워크 요청을 할 때 SSL 인증서를 확인합니다. --no-ssl-verify 옵션을 사용하여 SSL 인증서 확인을 사용 중지할 수 있습니다. 예시:

gh actions-importer audit --output-dir ./output --no-ssl-verify

부분은 MIT 라이선스에 따라 https://github.com/github/gh-actions-importer/에서 조정되었습니다.

MIT License

Copyright (c) 2022 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.