Add ability to provide token for private repo for requirements_git in container build (#15831)

Add ability to provide auth to private repo for requirements_git
This commit is contained in:
Hao Liu
2025-02-12 14:20:13 -05:00
committed by GitHub
parent 69a60493a3
commit f8ff48fe5c
8 changed files with 39 additions and 1 deletions

View File

@@ -4,6 +4,10 @@ inputs:
github-token:
description: GitHub Token for registry access
required: true
private-github-token:
description: GitHub Token for private repositories
required: false
default: ''
runs:
using: composite
steps:
@@ -22,6 +26,11 @@ runs:
run: |
echo "${{ inputs.github-token }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Add Private github token to requirements_git.credentials.txt
shell: bash
run: echo "https://x-access-token:${{ inputs.private-github-token }}@github.com" >> requirements/requirements_git.credentials.txt
if: ${{ inputs.private-github-token != '' }}
- name: Pre-pull latest devel image to warm cache
shell: bash
run: |