Sync #342
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/sync.yml | |
- workspace/sync/**/* | |
schedule: | |
- cron: '0 0 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
environment: FRONTMATTER_BOT | |
strategy: | |
fail-fast: false | |
matrix: | |
repo: | |
- trustwallet/assets | |
- ethereum-optimism/ethereum-optimism.github.io | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
- run: corepack enable pnpm | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm turbo run build | |
working-directory: workspace/sync | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
# PLEASE be aware that this is a security risk when you allow untrusted repositories to be checked out. | |
# While `pnpm run sync` is executed such that we're only reading files which pose no security risk, | |
# it's nonetheless possible through other means to execute arbitrary code | |
# when you attempt to do "TOO MUCH" outside its intended use case. | |
path: workspace/sync/repo | |
repository: ${{ matrix.repo }} | |
ref: master | |
- run: pnpm run sync ${{ matrix.repo }} | |
working-directory: workspace/sync | |
# - id: app | |
# uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
# with: | |
# app_id: ${{ secrets.SYNC_APP_ID }} | |
# private_key: ${{ secrets.SYNC_PRIVATE_KEY }} | |
# permission is set to `write` for `pull-requests` and `contents` | |
- uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 | |
with: | |
# token: ${{ steps.app.outputs.token }} | |
commit-message: 'chore(sync): ${{ matrix.repo }}' | |
title: 'chore(sync): ${{ matrix.repo }}' | |
body: | | |
#### What this PR does / why we need it: | |
Sync latest changes from `${{ matrix.repo }}` repository using `@workspace/sync`. | |
branch: sync/${{ matrix.repo }} |