aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/update-stops-data.yml
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-05-26 10:48:43 +0200
committerAriel Costas Guerrero <ariel@costas.dev>2025-05-26 10:48:43 +0200
commit5ced7f916d94e86e9a7ec164bee56f9a8e3a2a3a (patch)
treeb1ef5afa17b4a2f9fb2cbd683afc2fb6d905b5e1 /.github/workflows/update-stops-data.yml
parent4637373b50636e78dc2c7b6f99be879edb4ff7dc (diff)
Replace Azure SWA with custom server
Diffstat (limited to '.github/workflows/update-stops-data.yml')
-rw-r--r--.github/workflows/update-stops-data.yml13
1 files changed, 7 insertions, 6 deletions
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"