mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
4f37c39616
Gets rid of of all usages of the static `GH_TOKEN_PULL_REQUESTS` token that was issued for `vercel-release-bot`. We already create commits with `nextjs-bot`. `nextjs-bot` already had permissions to open PRs which is already being used by React sync.
69 lines
2.4 KiB
YAML
69 lines
2.4 KiB
YAML
name: Update Font Data
|
|
|
|
on:
|
|
# Run every every day at midnight https://crontab.guru/#0_0_*_*_*/1
|
|
schedule:
|
|
- cron: '0 0 * * */1'
|
|
# Allow manual runs
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
create-pull-request:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository_owner == 'vercel'
|
|
steps:
|
|
- name: Create GitHub App token
|
|
id: release-app-token
|
|
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
|
with:
|
|
client-id: ${{ vars.RELEASE_GITHUB_APP_CLIENT_ID }}
|
|
private-key: ${{ secrets.RELEASE_GITHUB_APP_PRIVATE_KEY }}
|
|
owner: ${{ github.repository_owner }}
|
|
repositories: next.js
|
|
permission-contents: write
|
|
permission-pull-requests: write
|
|
|
|
- name: Get GitHub App user ID
|
|
id: release-app-user
|
|
run: |
|
|
user_id="$(gh api "/users/${{ steps.release-app-token.outputs.app-slug }}[bot]" --jq .id)"
|
|
echo "user-id=$user_id" >> "$GITHUB_OUTPUT"
|
|
env:
|
|
GH_TOKEN: ${{ steps.release-app-token.outputs.token }}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
# Commits made with the default `GITHUB_TOKEN` won't trigger workflows.
|
|
# See: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
|
|
token: ${{ steps.release-app-token.outputs.token }}
|
|
persist-credentials: false
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version-file: .node-version
|
|
check-latest: true
|
|
package-manager-cache: false
|
|
|
|
- name: Setup corepack
|
|
run: |
|
|
npm i -g corepack@0.31
|
|
corepack enable
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: pnpm i
|
|
|
|
- name: Create Pull Request
|
|
shell: bash
|
|
run: node scripts/automated-update-workflow.js
|
|
env:
|
|
RELEASE_GITHUB_TOKEN: ${{ steps.release-app-token.outputs.token }}
|
|
RELEASE_GITHUB_APP_SLUG: ${{ steps.release-app-token.outputs.app-slug }}
|
|
RELEASE_GITHUB_APP_USER_ID: ${{ steps.release-app-user.outputs.user-id }}
|
|
BRANCH_NAME: fonts-data
|
|
SCRIPT: scripts/update-google-fonts.js
|
|
PR_TITLE: Update font data
|
|
PR_BODY: This auto-generated PR updates font data with latest available
|