Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google-fonts: fix permissions #183995

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 39 additions & 9 deletions .github/workflows/google-fonts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,50 @@ jobs:
- name: Import Google Fonts
run: ./developer/bin/import_google_fonts vendor/google-fonts ${{ matrix.mode }}

- name: Create pull request with updated files
- name: Check for changes
id: changes-check
run: |
set -euo pipefail

if ! git diff --stat --exit-code
if git diff --stat --exit-code
then
git checkout -b "auto-${{ matrix.mode }}-google-fonts"
echo "changes=false" >> "$GITHUB_ENV"
else
echo "changes=true" >> "$GITHUB_ENV"
fi

git commit -am "Update Google Fonts" -m "This pull request was created automatically by the [\`google-fonts\`](https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/google-fonts.yml) workflow."
- name: Checkout branch
if: env.changes == 'true'
bevanjkay marked this conversation as resolved.
Show resolved Hide resolved
run: git checkout -b "auto-${{ matrix.mode }}-google-fonts"

gh pr create --fill --head "auto-${{ matrix.mode }}-google-fonts"
fi
- name: Create commits
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."
env:
GH_TOKEN: ${{ github.token }}
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 }}

- name: Push commits
if: env.changes == 'true'
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
branch: "auto-${{ matrix.mode }}-google-fonts"

- name: Create pull request with updated files
if: env.changes == 'true'
env:
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
PR_BODY: >
This pull request was created automatically by the
[`google-fonts`](https://github.com/Homebrew/homebrew-cask/blob/master/.github/workflows/google-fonts.yml)
workflow.
run: |
gh pr create \
--base master \
--body "$PR_BODY" \
--head "auto-${{ matrix.mode }}-google-fonts" \
--title "${{matrix.mode}} Google Fonts"