-
Notifications
You must be signed in to change notification settings - Fork 162
Configure bot to sync skills and fix zizmor warnings #206
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
119d735
Configure bot to sync skills
johnpryan 185b954
Pin GitHub actions to hash
johnpryan 1b81a4f
Fix zizmor warnings
johnpryan 80480c7
add resolution:workspace to dart_skills_lint
johnpryan b630da4
Fix / ignore zizmor warnings
johnpryan 09973e9
use very_good_workflows to avoid zizmor warning
johnpryan 89a5f75
Fix zizmor warning
johnpryan f67e39d
update hash
johnpryan f911d21
Fix zizmor unpinned-uses by pinning very_good_coverage to hash with i…
johnpryan bb86ea4
use full commit SHA
johnpryan d8f8dff
Fix coverage tool
johnpryan b700630
Fix unpinned-uses error by stripping leading 'v' from 40-character co…
johnpryan 922cba5
Add explanation for zizmore: ignore comments
johnpryan b7e7996
use actions/checkout version 7.0.1
johnpryan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,74 +1,65 @@ | ||
| name: Sync Skills Directory via Git Hash (Dart) | ||
| name: Sync Skills Directory | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 0 * * *' # Keep the daily check as a fallback safety net | ||
| workflow_dispatch: # Keep manual run capability | ||
| repository_dispatch: | ||
|
johnpryan marked this conversation as resolved.
|
||
| types: [dart-skills-updated] # Listen for this custom ping | ||
| - cron: '0 0 * * *' # Runs daily at midnight UTC | ||
|
johnpryan marked this conversation as resolved.
|
||
| workflow_dispatch: # Allows manual triggering | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| # 1. Checkout Flutter Skills (Destination) | ||
| - name: Checkout Flutter Skills (Destination) | ||
| uses: actions/checkout@v7 | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| # Falls back to the default GITHUB_TOKEN if SYNC_PAT is not defined | ||
| token: ${{ secrets.SYNC_PAT || github.token }} | ||
| 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@v7 | ||
| 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@v1 | ||
| 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 | ||
| # Run our compiled-on-the-fly Dart script | ||
| EXIT_CODE=0 | ||
| dart run tool/sync_skills.dart ../src_repo skills || EXIT_CODE=$? | ||
|
|
||
| if [ $EXIT_CODE -eq 0 ]; then | ||
| echo "changes_detected=true" >> $GITHUB_OUTPUT | ||
| elif [ $EXIT_CODE -eq 10 ]; then | ||
| echo "changes_detected=false" >> $GITHUB_OUTPUT | ||
| echo "✅ Dart script signaled NO changes were found. Stopping workflow." | ||
| else | ||
| echo "❌ Dart script failed with error code $EXIT_CODE" | ||
| exit $EXIT_CODE | ||
| fi | ||
| 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@v8 | ||
| 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" | ||
| body: | | ||
|
johnpryan marked this conversation as resolved.
|
||
| ### 🤖 Automated Skills Sync & Version Bump (Dart Powered) | ||
| This is an automated pull request to sync the contents of the `skills/` directory from [dart-lang/skills](https://github.com/dart-lang/skills). | ||
|
|
||
| This run used a state-tracked Git hash (`.dart_skills_githash`) computed directly by our custom **Dart synchronization utility** (`tool/sync_skills.dart`). | ||
|
|
||
| ### 🛠️ Changes Performed: | ||
| * **Preserved:** All native `flutter/*` skills in the repository remain unchanged. | ||
| * **Synced:** All new, modified, or deleted files inside `dart-lang/skills` have been carried over. | ||
| * **Bumped:** Automatically incremented the plugin version field in `.claude-plugin/plugin.json` to keep integrations updated. | ||
| labels: | | ||
| automated-pr | ||
| sync | ||
| committer: flutter-skills-sync-bot <flutter-agent-sync-bot@google.com> | ||
| author: flutter-skills-sync-bot <flutter-agent-sync-bot@google.com> | ||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.