From cc4c651ffcd30d2c6ed1575af182d546360a4280 Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Tue, 1 Oct 2024 20:45:47 +1000 Subject: [PATCH] .github/workflows/google-fonts.yml: create individual commits --- .github/workflows/google-fonts.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/google-fonts.yml b/.github/workflows/google-fonts.yml index 72bd8a5a26c6..15dc213c81a2 100644 --- a/.github/workflows/google-fonts.yml +++ b/.github/workflows/google-fonts.yml @@ -71,16 +71,23 @@ jobs: run: git checkout -b "auto-${{ matrix.mode }}-google-fonts" - name: Create commits - if: env.changes == 'true' + if: env.changes == 'true' run: | - git add . - git commit \ - --message "${{matrix.mode}} Google Fonts" \ - --message "This commit was created automatically by the [\`google-fonts\`](https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/google-fonts.yml) workflow." + for FILENAME in $(git ls-files --modified); do + MESSAGE="$(echo "$FILENAME" | sed -e 's|^Casks/font/font-[a-z]/||' \ + -e 's/\.rb//' \ + -e 's/$/: /')" + git add "$FILENAME" + git commit "$FILENAME" --message="${MESSAGE} ${{matrix.mode}}" --message="$COMMIT_BODY" + done env: GIT_COMMITTER_NAME: ${{ steps.git-user-config.outputs.name }} GIT_COMMITTER_EMAIL: ${{ steps.git-user-config.outputs.email }} HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }} + COMMIT_BODY: > + This commit was created automatically by the + [\`google-fonts\`](https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/google-fonts.yml) + workflow. - name: Push commits if: env.changes == 'true'