-
Notifications
You must be signed in to change notification settings - Fork 11
Add workflow for updating Code of Conducts on change to this repository #259
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
Conversation
|
Thanks for the PR - Don't worry about the CI failures; we're dealing with the fallout of some recent changes made in other repositories. #258 should be a fix for those; we should be able to land that within a day or so. |
|
Excellent! I'll flip this off of draft so it can be reviewed whenever is best! |
freakboy3742
left a comment
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.
A couple of minor notes, but this looks great. I appreciate it's hard to test this one... I guess we'll find out when we use it in anger for the first time :-)
| uses: actions/checkout@v4 | ||
| - name: Update Code of Conduct | ||
| env: | ||
| GH_TOKEN: ${{ secrets.BRUTUS_PAT_TOKEN }} |
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.
Should this be:
| GH_TOKEN: ${{ secrets.BRUTUS_PAT_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.BRUTUS_PAT_TOKEN }} |
?
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.
I chose GH_TOKEN based on the example here, despite often using GITHUB_TOKEN myself. After a quick search, it seems to prioritize GH_TOKEN:
GH_TOKEN,GITHUB_TOKEN(in order of precedence): an authentication token that will be used when a command targets eithergithub.comor a subdomain ofghe.com. Setting this avoids being prompted to authenticate and takes precedence over previously stored credentials.
Not sure if GH_TOKEN is otherwise set, but this should for sure set it at highest precedence it seems.
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.
TIL. Thanks for the research.
.github/workflows/coc-update.yml
Outdated
|
|
||
| # Create the pull request | ||
| echo "Creating pull request to upstream..." | ||
| gh pr create --repo ${{ matrix.full_repo }} --title "Update Code of Conduct" --body "Updated using $GITHUB_REPOSITORY" |
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.
The PR title should probably include the date so we know it's the "2025-10-29 version" (and/or a repo hash?).
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.
Ah, good call, I can make that change!
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.
I opted to leave out the datetime in the latest commit because I wasn't sure if timezones and datelines could be a minor confusion (and just using a UTC timestamp seemed even less helpful). I did add the commit hash both the to PR body as well as the actual commit itself so that it would be easier to backtrack from the git log itself (as well as at review time).
Happy to add the date with some more direction of how to pick (e.g., at UTC or some other specific timezone)!
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.
Time is an illusion... and a hash is unambiguous, so lets go with that.
freakboy3742
left a comment
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.
Looks good - thanks for that update and research.
Now to hold our breath for the first live test... :-)
| uses: actions/checkout@v4 | ||
| - name: Update Code of Conduct | ||
| env: | ||
| GH_TOKEN: ${{ secrets.BRUTUS_PAT_TOKEN }} |
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.
TIL. Thanks for the research.
.github/workflows/coc-update.yml
Outdated
|
|
||
| # Create the pull request | ||
| echo "Creating pull request to upstream..." | ||
| gh pr create --repo ${{ matrix.full_repo }} --title "Update Code of Conduct" --body "Updated using $GITHUB_REPOSITORY" |
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.
Time is an illusion... and a hash is unambiguous, so lets go with that.
|
Fantastic! Please feel free to reach out here (or the Discord server, same username) if anything else comes up during the initial run! |
This allows the Code of Conduct to be updated in this repository, and for that change to be propagated to other public Beeware repositories. The strategy is a two step process: plan the repositories to update, then attempt to update them in parallel using a matrix. Changes result in a PR to relevant repositories by Brutus in a new git branch that is timestamped both for uniqueness and record-keeping.
Maintaining a CoC is good! Doing it multiple times is painful! This allows maintainers to standardize a Code of Conduct and simply propagate the change.
PR Checklist:
NOTE: To the honest best of my ability without going overboard at this stage. It is not impossible that I forgot some weird quirk of the way GitHub Actions handles permissions or something. I tested the premise of actually using the GitHub CLI. I can create test infrastructure to test if more confidence is desired and no additional changes are requested. I will say that nothing in this PR is destructive, so the worst case is a dud not a meltdown.