Skip to content
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

GH Actions: automate yearly update of test file #102

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 11, 2023

Description

Every year two of the fixed files for the tests for the Squiz.Commenting.FileComment sniff need to be updated to ensure they have the correct expected year. See: squizlabs/PHP_CodeSniffer#2793, squizlabs/PHP_CodeSniffer#3525, squizlabs/PHP_CodeSniffer#3737

So far this was always done manually and all PRs created in the new year would show a failing build until that PR was merged and the other PRs rebased.

This commit introduces a new workflow to automate those updates and automatically creates a PR at 5 minutes past midnight on the new year.

All that needs to happy then is to merge the PR promptly and all will be good.

Obviously, the true test of whether this workflow works will be on January 1st, but I've done some testing by manually reverting the change from January of this year and it all seems to look good.

Refs to actions used in this workflow:

Suggested changelog entry

N/A

Every year two of the `fixed` files for the tests for the `Squiz.Commenting.FileComment` sniff need to be updated to ensure they have the correct expected year.
See: squizlabs/PHP_CodeSniffer 2793, squizlabs/PHP_CodeSniffer 3525, squizlabs/PHP_CodeSniffer 3737

So far this was always done manually and all PRs created in the new year would show a failing build until that PR was merged and the other PRs rebased.

This commit introduces a new workflow to automate those updates and automatically creates a PR at 5 minutes past midnight on the new year.

All that needs to happy then is to merge the PR promptly and all will be good.

Obviously, the true test of whether this workflow works will be on January 1st, but I've done some testing by manually reverting the change from January of this year and it all seems to look good.

Refs to actions used in this workflow:
* https://github.com/jacobtomlinson/gha-find-replace
* https://github.com/peter-evans/create-pull-request
@jrfnl jrfnl added this to the 3.8.0 milestone Nov 11, 2023
@jrfnl jrfnl merged commit f9be7cf into master Nov 11, 2023
58 checks passed
@jrfnl jrfnl deleted the feature/ghactions-new-happy-new-year-workflow branch November 11, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant