-
Notifications
You must be signed in to change notification settings - Fork 0
chore: automate release train metadata sync #16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Release PR Sync Train | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| sync-release-train: | ||
| if: github.event.pull_request.head.repo.full_name == github.repository && github.head_ref == 'release-please--branches--main' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | ||
| with: | ||
| ref: ${{ github.head_ref }} | ||
| token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} | ||
|
|
||
| - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 | ||
| with: | ||
| channel: stable | ||
| cache: true | ||
|
|
||
| - name: sync release train metadata | ||
| run: dart tool/intentcall/bin/release_train.dart sync | ||
|
|
||
| - name: commit release train metadata | ||
| run: | | ||
| if git diff --quiet; then | ||
| echo "Release train metadata already synchronized." | ||
| exit 0 | ||
| fi | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git add packages/*/pubspec.yaml packages/intentcall_platform/ios/intentcall_platform.podspec packages/intentcall_platform/macos/intentcall_platform.podspec | ||
| git commit -m "chore: sync release train metadata" | ||
| git push origin HEAD:${{ github.head_ref }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,18 @@ publish-tag-execute tag: | |
| check-path-deps: | ||
| dart run tool/intentcall/bin/intentcall.dart check-path-deps | ||
|
|
||
| # Check release train metadata without requiring pub resolution | ||
| check-release-train: | ||
| dart tool/intentcall/bin/release_train.dart check | ||
|
|
||
| # Synchronize release train versions, internal floors, and native podspecs | ||
| sync-release-train: | ||
| dart run tool/intentcall/bin/intentcall.dart sync-release-train | ||
|
|
||
| # Synchronize release train metadata to a specific version | ||
| sync-release-train-version version: | ||
| dart run tool/intentcall/bin/intentcall.dart sync-release-train --version {{version}} | ||
|
Comment on lines
+53
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '## justfile targets\n'
git ls-files justfile
echo
echo '## relevant justfile excerpt'
nl -ba justfile | sed -n '45,70p'
echo
echo '## tool/intentcall/bin files'
git ls-files 'tool/intentcall/bin/*'
echo
echo '## search for release_train and sync-release-train references'
rg -n "release_train|sync-release-train|intentcall" justfile tool/intentcall/bin -g '!**/node_modules/**'
echo
echo '## outline release_train.dart if present'
if [ -f tool/intentcall/bin/release_train.dart ]; then
ast-grep outline tool/intentcall/bin/release_train.dart --view expanded || true
fiRepository: Arenukvern/intentcall Length of output: 258 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '## justfile excerpt'
sed -n '45,70p' justfile
echo
echo '## intentcall bin files'
git ls-files 'tool/intentcall/bin/*'
echo
echo '## release_train and sync references'
rg -n "release_train|sync-release-train|intentcall" justfile tool/intentcall/bin
echo
echo '## if release_train.dart exists, show its first 220 lines'
if [ -f tool/intentcall/bin/release_train.dart ]; then
sed -n '1,220p' tool/intentcall/bin/release_train.dart
fiRepository: Arenukvern/intentcall Length of output: 15712 Keep the sync targets dependency-free. 🤖 Prompt for AI Agents |
||
|
|
||
| # Print hosted dependencies block for the synchronized package train | ||
| print-hosted-deps: | ||
| dart run tool/intentcall/bin/intentcall.dart print-hosted-deps | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Drop the unused
pull-requests: writepermission.This job only needs to push commits back to the branch. Keeping PR-write scope here unnecessarily broadens the token if the workflow is ever repurposed or a later step is added.
Suggested fix
permissions: contents: write - pull-requests: write📝 Committable suggestion
🤖 Prompt for AI Agents