include permission

This commit is contained in:
leehk 2025-04-16 16:24:14 +08:00
parent d175a9e37d
commit 28791d0bca
2 changed files with 6 additions and 3 deletions

View File

@ -61,7 +61,10 @@ jobs:
test:
name: Run Tests
needs: build # Ensure this job runs after the build job
# Define necessary permissions if needed (e.g., for GitHub Packages)
permissions:
contents: read
packages: write # If pushing to GitHub Packages registry
# Call the reusable workflow for testing
uses: ./.github/workflows/template_test.yml # Path to the reusable workflow file
with:

View File

@ -85,7 +85,7 @@ jobs:
foreach ($img in $images) {
$serviceName = $img.name
$svc = @{}
$svc.image = "ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/$($serviceName):${{ env.TAG }}" # Use run_id tag
$svc.image = "${{ env.IMAGE_REPO }}/$($serviceName):${{ env.TAG }}" # Use run_id tag
if ($img.depends_on) {
$svc.depends_on = $img.depends_on
@ -165,7 +165,7 @@ jobs:
$ENV_ARGS \
-v "$STAGING_DIR:$RESULTS_PATH" \
--rm \
"ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/$($serviceName)/${{ inputs.testContainerName }}:${{ github.run_id }}" \
"${{ env.IMAGE_REPO }}/${{ inputs.testContainerName }}:${{ github.run_id }}" \
"$test_dir"
# Add error handling if needed (e.g., exit script if a test run fails)
if [ $? -ne 0 ]; then