From ce81d67b1dc4b4fc254ab346fa7d8153199a00d6 Mon Sep 17 00:00:00 2001 From: +shyfire131 <116033104+shyfire131@users.noreply.github.com> Date: Tue, 23 May 2023 07:18:17 -0600 Subject: [PATCH] Submit PRs for LnProxy relay list updates (#613) Instead of committing directly to main, create a new PR instead Co-authored-by: +shyfire131 --- .github/workflows/lnproxy-sync.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/lnproxy-sync.yml b/.github/workflows/lnproxy-sync.yml index 2f851664..66bf9fcf 100644 --- a/.github/workflows/lnproxy-sync.yml +++ b/.github/workflows/lnproxy-sync.yml @@ -11,23 +11,30 @@ jobs: permissions: contents: write + pull-requests: write steps: - name: Checkout uses: actions/checkout@v3 - - name: Fetch and process JSON + - name: Fetch and process lnproxy relay JSON file run: | curl https://raw.githubusercontent.com/lnproxy/lnproxy-webui2/main/assets/relays.json -o lnproxy_tmplist.json node .github/workflows/scripts/lnproxy-sync.js - - - name: Commit and push if it's not up to date - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" git add ./frontend/static/lnproxies.json - git diff --quiet && git diff --staged --quiet || git commit -m "Update LNProxy relay list" - git push - name: Remove tmp lnproxy json file run: rm lnproxy_tmplist.json + + - name: Get the date for use in subsequent steps + id: getdate + run: echo "current_date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: Submit pull request + uses: peter-evans/create-pull-request@v5 + with: + commit-message: "Update LNProxy relay list on ${{ env.current_date }}" + committer: GitHub Action + branch: "lnproxy-${{ env.current_date }}" + delete-branch: true + title: "[GitHub Action] Update LNProxy relay list ${{ env.current_date }}"