-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add action to automatically check for updates and create a PR #83
base: master
Are you sure you want to change the base?
Conversation
- name: Create PR | ||
id: commit_changes | ||
if: env.CHANGES_DETECTED == 'true' | ||
run: | | ||
git checkout -b "updates/update_${TZDATA_VERSION}" | ||
git commit -m "Update tzdata to version $TZDATA_VERSION" \ | ||
-m "$TZDATA_NEWS" | ||
git push --force origin "updates/update_${TZDATA_VERSION}" | ||
|
||
- name: Create pull request | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: env.CHANGES_DETECTED == 'true' | ||
run: | | ||
gh pr create --title "Update tzdata to version $TZDATA_VERSION" \ | ||
--body "$TZDATA_NEWS" \ | ||
--base master \ | ||
--head $(git rev-parse --abbrev-ref HEAD) \ | ||
--label "automatic-updates" |
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.
We have both "Create PR" and "Create pull request" steps here. Should there be only one?
The second one failed here: https://github.com/python/tzdata/actions/runs/11019333824/job/30601666394?pr=82
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, that's I think a naming problem. The first one commits the changes, the second one creates the pull request.
The second one failed yesterday because it was being triggered from a PR. It worked successfully when I manually triggered it on my own fork, so I think this will work next time there's a tzdata update: https://github.com/pganssle/tzdata/actions/runs/11020129915/job/30604223890
7a68346
to
88bfc68
Compare
First thing to do is to make sure that the
tox -e update
script doesn't do anything if you are already on the latest version. If it finds anything, we're ready for an update. This will create a release candidate.Fixes #8