Files
flutter__agent-plugins/.github/workflows/block-dart-skills-prs.yaml
dependabot[bot] 6195d6f060 Bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [actions/github-script](https://github.com/actions/github-script) and [VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml](https://github.com/verygoodopensource/very_good_workflows).


Updates `actions/github-script` from 7.1.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/f28e40c7f34bde8b3046d885e986cb6290c5673b...3a2844b7e9c422d3c10d287c895573f7108da1b3)

Updates `VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml` from 86e2d68bb1e27b2518e4a2277205d23d21cb413c to 75f342c5d0b8c8adde3a2b7ea101e7e47897d1fc
- [Release notes](https://github.com/verygoodopensource/very_good_workflows/releases)
- [Changelog](https://github.com/VeryGoodOpenSource/very_good_workflows/blob/main/CHANGELOG.md)
- [Commits](https://github.com/verygoodopensource/very_good_workflows/compare/86e2d68bb1e27b2518e4a2277205d23d21cb413c...75f342c5d0b8c8adde3a2b7ea101e7e47897d1fc)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml
  dependency-version: 75f342c5d0b8c8adde3a2b7ea101e7e47897d1fc
  dependency-type: direct:production
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-03 16:54:46 +00:00

59 lines
2.5 KiB
YAML

name: Block Upstream Skill Modifications
permissions:
contents: read
pull-requests: write
# zizmor: ignore[dangerous-triggers] - {Needed to detect when Dart skills are modified}
on:
# zizmor: ignore[dangerous-triggers] - {Needed to detect when Dart skills are modified}
pull_request_target:
types: [opened, synchronize, reopened]
paths:
# Triggers if any file inside folders prefixed with "dart-" is modified
- 'skills/dart-**'
jobs:
prevent-modifications:
runs-on: ubuntu-latest
permissions:
pull-requests: write
# Skip the block check ONLY if the PR is originating from the sync branch on the main repository.
if: |
github.event.pull_request.head.repo.full_name != github.repository ||
github.event.pull_request.head.ref != 'automation/sync-dart-skills'
steps:
- name: Fail Action and Comment on PR
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const prNumber = context.payload.pull_request.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
// Retrieve comments to avoid duplicate spam
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number: prNumber,
});
const botCommentIdentifier = "⚠️ **DO NOT modify these files!**";
const alreadyCommented = comments.some(comment => comment.body.includes(botCommentIdentifier));
if (!alreadyCommented) {
const message = `⚠️ **DO NOT modify these files!**\n\n` +
`The files within \`skills/dart-*\` are **automatically synchronized** from the upstream [dart-lang/skills](https://github.com/dart-lang/skills) repository.\n\n` +
`Please close this Pull Request and submit your changes to the [upstream repository](https://github.com/dart-lang/skills) instead. Once merged upstream, your updates will be automatically brought over here.`;
await github.rest.issues.createComment({
owner,
repo,
issue_number: prNumber,
body: message
});
}
// Fail the workflow to block the PR from merging
core.setFailed("Direct changes to synced Dart skills are prohibited in this repository.");