Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- 'requirements.txt'
- 'scripts/**'
- 'container_overrides/**'
- '.github/workflows/main.yml'
# Runs automatically every day at 0:00 UTC (8:00 AM Beijing Time)
schedule:
- cron: '0 0 * * *'
Expand Down Expand Up @@ -331,18 +330,7 @@ jobs:
gcloud secrets versions list "${secret_name}" \
--project "${GCP_PROJECT_ID}" \
--format=json \
| python -c 'import json,sys
rows = json.load(sys.stdin)
active = [
int(row["name"].rsplit("/", 1)[-1])
for row in rows
if row.get("state") in {"ENABLED", "DISABLED"}
]
if len(active) <= 1:
sys.exit(0)
keep = max(active)
print("\n".join(str(version) for version in active if version != keep))
'
| python3 -c 'import json, sys; rows = json.load(sys.stdin); active = [int(row["name"].rsplit("/", 1)[-1]) for row in rows if row.get("state") in {"ENABLED", "DISABLED"}]; keep = max(active) if active else None; print("\n".join(str(version) for version in active if version != keep))'
)"

while IFS= read -r version; do
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflow_shared_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ grep -Fq 'gcloud secrets versions add "${secret_name}"' "$workflow_file"
grep -Fq "paths:" "$workflow_file"
grep -Fq "'scripts/**'" "$workflow_file"
grep -Fq "'container_overrides/**'" "$workflow_file"
grep -Fq "'.github/workflows/main.yml'" "$workflow_file"
! grep -Fq "'.github/workflows/main.yml'" "$workflow_file"
grep -Fq 'DEPLOY_MODE="full"' "$workflow_file"
grep -Fq 'if [ "${DEPLOY_EVENT_NAME}" = "schedule" ]; then' "$workflow_file"
grep -Fq 'elif [ "${DEPLOY_EVENT_NAME}" = "workflow_dispatch" ]; then' "$workflow_file"
Expand Down