From 5ced7f916d94e86e9a7ec164bee56f9a8e3a2a3a Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Mon, 26 May 2025 10:48:43 +0200 Subject: Replace Azure SWA with custom server --- .github/workflows/update-stops-data.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to '.github/workflows/update-stops-data.yml') diff --git a/.github/workflows/update-stops-data.yml b/.github/workflows/update-stops-data.yml index 8e0def9..5a1ace3 100644 --- a/.github/workflows/update-stops-data.yml +++ b/.github/workflows/update-stops-data.yml @@ -14,10 +14,10 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 - + - name: Run download script run: uv run data/download-stops.py - + - name: Commit changes if any id: commit run: | @@ -36,7 +36,7 @@ jobs: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT echo "changes_made=true" >> $GITHUB_OUTPUT fi - + - name: Create Pull Request if: steps.commit.outputs.changes_made == 'true' env: @@ -45,19 +45,20 @@ jobs: run: | # Close any existing PRs created by this action existing_prs=$(gh pr list --json number,title,headRefName --search "Update stops data in:title head:update-stops-data- author:app/github-actions is:open") - + if [[ $(echo "$existing_prs" | jq length) -gt 0 ]]; then echo "Found existing PRs to close" echo "$existing_prs" | jq -c '.[]' | while read pr; do pr_number=$(echo "$pr" | jq -r '.number') echo "Closing PR #$pr_number" gh pr close $pr_number --comment "Superseded by a new PR with updated data" + gh branch delete $(echo "$pr" | jq -r '.headRefName') --force done fi - + # Create new PR gh pr create \ --title "Update stops data" \ --body "Automatically generated PR with updated stops data from scheduled fetch." \ --base main \ - --head "$BRANCH_NAME" \ No newline at end of file + --head "$BRANCH_NAME" -- cgit v1.3