From 6defae71c6f33873802c661b595c2062504b5423 Mon Sep 17 00:00:00 2001 From: a1denvalu3 <> Date: Tue, 13 Jan 2026 00:27:10 +0100 Subject: [PATCH 1/2] fetch georelays working workflow --- .github/workflows/fetch_georelays.yml | 55 +++++++-------------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/.github/workflows/fetch_georelays.yml b/.github/workflows/fetch_georelays.yml index 3e44dd55..048e97cd 100644 --- a/.github/workflows/fetch_georelays.yml +++ b/.github/workflows/fetch_georelays.yml @@ -25,47 +25,18 @@ jobs: wget -q https://raw.githubusercontent.com/permissionlesstech/georelays/refs/heads/main/nostr_relays.csv mv nostr_relays.csv ./relays/online_relays_gps.csv - - name: Configure git + - name: Check for changes + id: git-check run: | - git config user.email "action@github.com" - git config user.name "GitHub Action" - - - name: Create update branch if changes - id: create_branch + git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT + + - name: Commit and push changes + if: steps.git-check.outputs.changes == 'true' run: | - # exit early if no changes - if git diff --quiet --relays/online_relays_gps.csv; then - echo "changed=false" >> $GITHUB_OUTPUT - exit 0 - fi - - # branch name with timestamp - BRANCH="update-georelays-$(date -u +%Y%m%dT%H%M%SZ)" - git checkout -b "$BRANCH" - - git add relays/online_relays_gps.csv - git commit -m "Automated update of relay data - $(date -u --rfc-3339=seconds)" - echo "changed=true" >> $GITHUB_OUTPUT - echo "branch=$BRANCH" >> $GITHUB_OUTPUT - - - name: Push branch - if: steps.create_branch.outputs.changed == 'true' - run: | - git push --set-upstream origin "${{ steps.create_branch.outputs.branch }}" - - - name: Create pull request - if: steps.create_branch.outputs.changed == 'true' - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Automated update of relay data - branch: ${{ steps.create_branch.outputs.branch }} - base: main - title: Automated update of relay data - body: | - This PR was created automatically by the scheduled workflow. It updates relays/online_relays_gps.csv from the GeoRelays source. - labels: automated, georelays - - - name: No changes - if: steps.create_branch.outputs.changed != 'true' - run: echo "No changes to relays/online_relays_gps.csv" \ No newline at end of file + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add app/src/main/assets/nostr_relays.csv + git commit -m "Automated update of relay data - $(date -u)" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 238311aefb6dad8da1a5a682c2ec623bb9d71b21 Mon Sep 17 00:00:00 2001 From: a1denvalu3 <> Date: Tue, 13 Jan 2026 00:57:20 +0100 Subject: [PATCH 2/2] fix typo --- .github/workflows/fetch_georelays.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fetch_georelays.yml b/.github/workflows/fetch_georelays.yml index 048e97cd..6aaf6693 100644 --- a/.github/workflows/fetch_georelays.yml +++ b/.github/workflows/fetch_georelays.yml @@ -35,7 +35,7 @@ jobs: run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - git add app/src/main/assets/nostr_relays.csv + git add relays/online_relays_gps.csv git commit -m "Automated update of relay data - $(date -u)" git push env: