mirror of
https://github.com/flutter/agent-plugins.git
synced 2026-09-14 16:19:33 +08:00
66 lines
2.3 KiB
YAML
66 lines
2.3 KiB
YAML
name: Sync Skills Directory
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * *' # Runs daily at midnight UTC
|
|
workflow_dispatch: # Allows manual triggering
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# 1. Checkout Flutter Skills (Destination)
|
|
- name: Checkout Flutter Skills (Destination)
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
token: ${{ secrets.SYNC_PAT || github.token }} # Falls back to default if SYNC_PAT is undefined
|
|
persist-credentials: false
|
|
path: dest_repo
|
|
|
|
# 2. Checkout Dart Skills (Source)
|
|
- name: Checkout Dart Skills (Source)
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
repository: dart-lang/skills
|
|
fetch-depth: 50
|
|
persist-credentials: false
|
|
path: src_repo
|
|
|
|
# 3. Setup Dart Environment
|
|
- name: Setup Dart Environment
|
|
uses: dart-lang/setup-dart@65eb853c7ba17dde3be364c3d2858773e7144260 # v1.7.2
|
|
with:
|
|
sdk: stable
|
|
|
|
# 4. Sync files and copy
|
|
- name: Execute Dart Sync Engine
|
|
id: sync_engine
|
|
run: |
|
|
cd dest_repo
|
|
dart run tool/sync_skills.dart ../src_repo skills
|
|
|
|
# 5. Configure Git Credentials under allowlisted Robot Bot
|
|
- name: Configure Git Credentials
|
|
run: |
|
|
git config --global user.name "flutter-skills-sync-bot"
|
|
git config --global user.email "flutter-agent-sync-bot@google.com"
|
|
env:
|
|
GH_TOKEN: ${{ secrets.SYNC_PAT || github.token }}
|
|
|
|
# 6. Create Pull Request using custom PAT credentials
|
|
- name: Create Pull Request
|
|
if: steps.sync_engine.outputs.changes_detected == 'true'
|
|
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 (Pinned to official hash)
|
|
with:
|
|
token: ${{ secrets.SYNC_PAT || github.token }}
|
|
path: dest_repo
|
|
branch: automation/sync-dart-skills
|
|
title: "🤖 chore: sync skills directory from dart-lang/skills"
|
|
commit-message: "chore: auto-sync skills directory from dart-lang/skills"
|
|
committer: flutter-skills-sync-bot <flutter-agent-sync-bot@google.com>
|
|
author: flutter-skills-sync-bot <flutter-agent-sync-bot@google.com>
|