From 45a33037b07cdb02887670b9b6a5aeaaf65d874a Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Thu, 28 Nov 2024 00:18:41 +0300 Subject: [PATCH] Fix nanomaps render failures (#27453) * Prevent Nanomaps Render failure if no changes * Catch stderr, do not fail with 78 * This does not apply here --- .github/workflows/render_nanomaps.yml | 59 ++++++++++++++------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/workflows/render_nanomaps.yml b/.github/workflows/render_nanomaps.yml index c9449cc382dbd..1dd4b192fb944 100644 --- a/.github/workflows/render_nanomaps.yml +++ b/.github/workflows/render_nanomaps.yml @@ -6,7 +6,7 @@ name: 'Render Nanomaps' on: schedule: - - cron: "0 0 * * *" + - cron: '0 0 * * *' workflow_dispatch: jobs: @@ -14,36 +14,37 @@ jobs: name: 'Generate NanoMaps' runs-on: ubuntu-22.04 steps: - - id: create_token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.PRIVATE_KEY }} + - id: create_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} - - run: echo "GH_TOKEN=${{ steps.create_token.outputs.token }}" >> "$GITHUB_ENV" + - run: echo "GH_TOKEN=${{ steps.create_token.outputs.token }}" >> "$GITHUB_ENV" - - name: 'Update Branch' - uses: actions/checkout@v4 - with: - token: ${{ steps.create_token.outputs.token }} + - name: 'Update Branch' + uses: actions/checkout@v4 + with: + token: ${{ steps.create_token.outputs.token }} - - name: Branch - run: | - git branch -f nanomap-render - git checkout nanomap-render - git reset --hard origin/master + - name: Branch + run: | + git branch -f nanomap-render + git checkout nanomap-render + git reset --hard origin/master - - name: 'Generate Maps' - run: './tools/github-actions/nanomap-renderer-invoker.sh' + - name: 'Generate Maps' + run: './tools/github-actions/nanomap-renderer-invoker.sh' - - name: 'Commit Maps and open PR' - run: | - git config --local user.email "action@github.com" - git config --local user.name "NanoMap Generation" - git pull origin master - git commit -m "NanoMap Auto-Update (`date`)" -a || true - git push -f -u origin nanomap-render - result=$(gh pr create -t "Automatic NanoMap Update" -b "This pull request updates the server NanoMaps. Please review the diff images before merging." -l "NanoMaps" -H "nanomap-render" -B "master") - if echo "$result" | grep -q "No commits between master and nanomap-render" - echo "No NanoMaps update required, skipping." - exit 78 + - name: 'Commit Maps and open PR' + run: | + git config --local user.email "action@github.com" + git config --local user.name "NanoMap Generation" + git pull origin master + git commit -m "NanoMap Auto-Update (`date`)" -a || true + git push -f -u origin nanomap-render + result=$(gh pr create -t "Automatic NanoMap Update" -b "This pull request updates the server NanoMaps. Please review the diff images before merging." -l "NanoMaps" -H "nanomap-render" -B "master" 2>&1) || true + echo "$result" + if echo "$result" | grep -q "No commits between master and nanomap-render"; then + echo "No NanoMaps update required, skipping." + fi