Replies: 2 comments 4 replies
-
|
I know Renovate supports Copier (https://docs.renovatebot.com/modules/manager/copier/), but I'd like a standalone solution 🙂 Hmm, still maybe a Renovate-based workflow could be added to the docs too! |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
A bit more complex than I anticipated: name: copier
on: push
# schedule:
# - cron: "0 18 * * 4"
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup uv
uses: astral-sh/setup-uv@v1
with:
enable-cache: true
- name: Checkout new branch
run: |
git branch -D copier-update || true
git push origin --delete copier-update || true
git checkout -b copier-update
- name: Run Copier update
run: |
uvx --from copier==9.3.* --with copier-templates-extensions copier update --trust --skip-answered --defaults
git diff --name-only --diff-filter=U | while read -r file; do git checkout --theirs "$file"; done
- name: Commit changes and create PR
run: |
git config --global user.name "Timothée Mazzucotelli"
git config --global user.email "pawamoy@users.noreply.github.com"
git add -A .
if git commit -am "chore: Template upgrade"; then \
git push --set-upstream origin copier-update; \
gh pr create -B main -H copier-update --title 'chore: Template upgrade' --body ''; \
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}And conflict resolution doesn't work yet because of this issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Does anyone have an example of a GitHub workflow that periodically runs
copier updatein a project and sends a PR if there are changes? I'd be interested in setting this up for my multitude of copier-generated projects 🙂 Then such a workflow could be added to the docs, or even be made into a proper GitHub Action (though I suspect the workflow will be very short anyway, so a GitHub Action might be overkill).Beta Was this translation helpful? Give feedback.
All reactions