Test supports remote

This commit is contained in:
estebanthi
2025-10-19 20:38:06 +02:00
parent d8bfaabffe
commit c0600e752d
2 changed files with 103 additions and 2 deletions

View File

@@ -33,12 +33,42 @@ inputs:
github_token:
description: 'GitHub token for metadata extraction'
required: true
repository_checkout:
description: 'Repository to checkout (if different from the current one)'
required: false
default: ''
ref_checkout:
description: 'Git ref (branch/tag/SHA) to checkout in the external repo'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Checkout repository
- name: Checkout external repository
if: ${{ inputs.repository_checkout != '' }}
uses: actions/checkout@v5
with:
repository: ${{ inputs.repository_checkout }}
ref: ${{ inputs.ref_checkout != '' && inputs.ref_checkout || 'main' }}
server-url: ${{ github.server_url }}
path: external-src
fetch-depth: 0
- name: Checkout repository
if: ${{ inputs.repository_checkout == '' }}
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set build context path if remote specified else local
id: set-context
run: |
if [ "${{ inputs.repository_checkout }}" != "" ]; then
echo "context_path=external-src" >> $GITHUB_OUTPUT
else
echo "context_path=${{ inputs.context_path }}" >> $GITHUB_OUTPUT
fi
- name: Define branch helpers
id: branch
@@ -79,7 +109,7 @@ runs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ inputs.context_path }}
context: ${{ steps.set-context.outputs.context_path }}
file: ${{ inputs.dockerfile_path }}
push: true
platforms: ${{ inputs.platforms }}