[ci] Add a workflow to auto-remove CICD label#11301
Conversation
See flutter/flutter#183675. This replicates that script to this repo, until such time as the entire flow is fully centralized.
There was a problem hiding this comment.
Code Review
This pull request introduces a new GitHub Actions workflow, .github/remove_cicd.yaml, designed to automatically remove the 'CICD' label from pull requests when new code is pushed. This is a replication of a similar workflow from the flutter/flutter repository.
My review identifies two areas for improvement:
- A logic correction to more accurately determine the push time, ensuring stale labels are reliably removed.
- A suggestion to tighten permissions by removing a permission that appears to be unnecessary, adhering to the principle of least privilege.
.github/remove_cicd.yml
Outdated
| # Get push time (commit date of the head SHA) | ||
| PUSH_TIME=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }} --jq '.commit.committer.date') |
There was a problem hiding this comment.
The current method of determining the "push time" by using the head commit's committer date can be inaccurate. If a commit that was created in the past is pushed to the branch, its committer date will be old, and the script might fail to remove a stale 'CICD' label.
A more reliable and simpler way to get the time of the push for a synchronize event is to use github.event.pull_request.updated_at. This timestamp reflects when the PR was last updated, which corresponds to the push.
# Get PR update time, which corresponds to the push time for a synchronize event
PUSH_TIME='${{ github.event.pull_request.updated_at }}'There was a problem hiding this comment.
I think this is a valid criticism. The remedy sounds good assuming that is a real piece of information we can grab and it is in the correct iso format.
tarrinneal
left a comment
There was a problem hiding this comment.
gemini's comments look solid to me, but I understand if you want to keep it the same as the other.
|
I think it'll be easiest to maintain if all the copies are identical. |
|
autosubmit label was removed for flutter/packages/11301, because - The status or check suite Mac_arm64 ios_platform_tests_shard_3 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
Agreed on identical. @gaaclarke - what do you think about the comments ? |
|
autosubmit label was removed for flutter/packages/11301, because - The status or check suite Mac_arm64 ios_platform_tests_shard_3 master has failed. Please fix the issues identified (or deflake) before re-applying this label. |
responded inline |
flutter/packages@8dcfd11...5909bdd 2026-03-25 47866232+chunhtai@users.noreply.github.com [ci] add more permissions for create-pull-request (flutter/packages#11302) 2026-03-25 stuartmorgan@google.com [various] Add `unintended_html_in_doc_comment` to analysis options (flutter/packages#11303) 2026-03-25 matt.boetger@gmail.com Use deprecated dependency until legacy renderer is removed (flutter/packages#11185) 2026-03-25 louisehsu@google.com [in_app_purchase_storekit] Address flaky tests (flutter/packages#11270) 2026-03-25 stuartmorgan@google.com [google_maps_flutter] Fix A2A iOS builds (flutter/packages#11290) 2026-03-25 stuartmorgan@google.com [mustache_template] Fix broken README link (flutter/packages#11306) 2026-03-25 stuartmorgan@google.com [ci] Add a workflow to auto-remove CICD label (flutter/packages#11301) 2026-03-25 stuartmorgan@google.com [various] Convert plugin builds to Kotlin gradle (flutter/packages#11172) 2026-03-25 spkhalad@gmail.com [webview_flutter_platform_interface] Add support for getting cookie (flutter/packages#11037) 2026-03-25 stuartmorgan@google.com [cupertino_icons] Remove empty Dart file (flutter/packages#11308) 2026-03-25 stuartmorgan@google.com [camera] Regenerate iOS example with Swift (flutter/packages#11283) 2026-03-25 tarrinneal@gmail.com [pigeon] Optimize data class equality and hashing in Dart, Kotlin, java, and Swift, adds equality in other languages (flutter/packages#11140) 2026-03-25 katelovett@google.com [two_dimensional_scrollables] Fix span border decorations in flipped cross axes (flutter/packages#11334) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
See flutter/flutter#183675 and flutter/flutter#183905. This replicates that script to this repo, until such time as the entire flow is fully centralized.