Template sync #29227
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: Template sync | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '*/5 * * * *' | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
sync: | |
name: Sync | |
runs-on: packages | |
container: node:22 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Sync from template | |
id: sync_from_template | |
uses: tenantcloud/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Reformat using Prettier | |
uses: actionsx/prettier@v3 | |
with: | |
args: --write . | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: dom, libxml, mbstring | |
tools: composer:v2 | |
coverage: none | |
- name: Composer cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: composer-${{ hashFiles('composer.json') }} | |
- name: Reformat using php-cs-fixer | |
run: | | |
composer install | |
composer cs-fix | |
- name: Generate token to read from source repo | |
id: generate_token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.PACKAGE_SYNC_APP_ID }} | |
private_key: ${{ secrets.PACKAGE_SYNC_PRIVATE_KEY }} | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
committer: 'package-sync[bot] <165811605+package-sync[bot]@users.noreply.github.com>' | |
branch: 'template-sync' | |
delete-branch: true | |
title: 'chore: Sync changes from the template' | |
commit-message: 'chore: Sync changes from the template' | |
body: ${{ steps.sync_from_template.outputs.report }} | |
assignees: oprypkhantc | |
reviewers: oprypkhantc | |
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
# GitHub automatically disables `schedule` workflows in public repositories | |
# after 60 days without commits, so this job is there to prevent it. | |
workflow-keepalive: | |
name: Workflow keepalive | |
runs-on: packages | |
container: maniator/gh:v2.48.0 | |
if: github.event_name == 'schedule' | |
permissions: | |
actions: write | |
steps: | |
- uses: liskin/gh-workflow-keepalive@v1 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |