Skip to content

[ci] Add a workflow to auto-remove CICD label#11301

Open
stuartmorgan-g wants to merge 3 commits intomainfrom
cicd-removal-workflow
Open

[ci] Add a workflow to auto-remove CICD label#11301
stuartmorgan-g wants to merge 3 commits intomainfrom
cicd-removal-workflow

Conversation

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Mar 19, 2026

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.

See flutter/flutter#183675. This replicates that script to this repo, until such time as the entire flow is fully centralized.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. A logic correction to more accurately determine the push time, ensuring stale labels are reliably removed.
  2. A suggestion to tighten permissions by removing a permission that appears to be unnecessary, adhering to the principle of least privilege.

Comment on lines +23 to +24
# 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')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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 }}'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gemini's comments look solid to me, but I understand if you want to keep it the same as the other.

@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label Mar 19, 2026
@stuartmorgan-g
Copy link
Collaborator Author

I think it'll be easiest to maintain if all the copies are identical.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 19, 2026

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.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2026
@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2026
@jtmcdole
Copy link
Member

Agreed on identical. @gaaclarke - what do you think about the comments ?

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 19, 2026

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.

@gaaclarke
Copy link
Member

Agreed on identical. @gaaclarke - what do you think about the comments ?

responded inline

@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants