Skip to content

Commit 359a6a5

Browse files
authored
fix(ci): pass --project_id to bq to prevent CLOUDSDK_CORE_PROJECT override (#110)
secrets-to-env-action leaks CLOUDSDK_CORE_PROJECT=kestra-host into all CI steps, overriding gcloud config set project. Pass --project_id explicitly to bq commands so the correct kestra-unit-test project is always used.
1 parent 74023ff commit 359a6a5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/cleanup-unit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ TABLES=(
2020

2121
for TABLE in "${TABLES[@]}"; do
2222
echo "🗑️ Deleting table ${TABLE}..."
23-
bq rm -f -t "${PROJECT_ID}:${DATASET}.${TABLE}" || echo "⚠️ Table ${TABLE} not found, skipping."
23+
bq rm --project_id="${PROJECT_ID}" -f -t "${PROJECT_ID}:${DATASET}.${TABLE}" || echo "⚠️ Table ${TABLE} not found, skipping."
2424
done
2525

2626
echo "✅ Test tables cleaned up successfully"

.github/setup-unit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ gcloud config set project "${PROJECT_ID}" >/dev/null
1313
echo "📋 Creating test tables in existing dataset ${PROJECT_ID}:${DATASET}..."
1414

1515
# orderDetail table: used in 'run' and 'error' tests
16-
bq query --use_legacy_sql=false "
16+
bq query --project_id="${PROJECT_ID}" --use_legacy_sql=false "
1717
CREATE OR REPLACE TABLE \`${PROJECT_ID}.${DATASET}.orderDetail\` AS
1818
SELECT 1 AS id, 10.5 AS unitPrice, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY) AS addedDate
1919
UNION ALL
2020
SELECT 2 AS id, 200.0 AS unitPrice, TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 2 DAY) AS addedDate;
2121
"
2222

2323
# territory table: used in 'failed' test
24-
bq query --use_legacy_sql=false "
24+
bq query --project_id="${PROJECT_ID}" --use_legacy_sql=false "
2525
CREATE OR REPLACE TABLE \`${PROJECT_ID}.${DATASET}.territory\` AS
2626
SELECT 1 AS id, 'North' AS name, 1 AS regionId
2727
UNION ALL

0 commit comments

Comments
 (0)