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

Add action to automatically check for updates and create a PR #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pganssle
Copy link
Member

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

@pganssle pganssle requested a review from hugovk September 24, 2024 19:08
Comment on lines 93 to 111
- 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"
Copy link
Member

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

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automated PR bot
2 participants