From 7a91514a09b7c4c1bb152365075233a5898fc849 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Tue, 24 Oct 2023 20:41:54 +0200 Subject: [PATCH] split update and commit --- .github/workflows/deploy-to-dotorg.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-to-dotorg.yml b/.github/workflows/deploy-to-dotorg.yml index eab09577..1948efb2 100644 --- a/.github/workflows/deploy-to-dotorg.yml +++ b/.github/workflows/deploy-to-dotorg.yml @@ -32,25 +32,25 @@ jobs: # Runs a single command using the runners shell # This script fetchs the Goolgle Fonts API data and creates a PR if new data is available - - name: Update Google Fonts JSON + - name: Update Google Fonts JSON file env: GOOGLE_FONTS_API_KEY: ${{ secrets.GOOGLE_FONTS_API_KEY }} - BRANCH_NAME: update/google-fonts-json-${{ steps.date.outputs.date }}_${{ github.run_id }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo "Updating Google fonts JSON" + echo "Updating Google fonts JSON file" node ./update-google-fonts-json-file.js + - name: Commit Changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' git config --global --add --bool push.autoSetupRemote true git diff-index --quiet HEAD -- || \ ( git add assets/google-fonts/fallback-fonts-list.json && \ - git checkout -b ${{ env.BRANCH_NAME }} && \ - git commit -m "Update Google Fonts file" --no-verify && \ - git push && \ - gh pr create -B trunk -H ${{ env.BRANCH_NAME }} --title "Update Google Fonts JSON data from API" --body "Created by Update Google Fonts JSON Github action" && \ - gh pr merge --squash ${{ env.BRANCH_NAME }} \ + git checkout trunk && \ + git commit -m "Automation: update Google Fonts data file" --no-verify && \ + git push ) tag: name: Checkout repo