-
Notifications
You must be signed in to change notification settings - Fork 43
👷 Enable templating for common files #1005
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks @denialhaag for churning this out so quickly. This is already a great start. I'll simultaneously write a review in the .github
repo PR to summarize my thoughts.
Some minor inline thoughts and inspiration already here.
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
workflow_dispatch: |
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.
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
workflow_dispatch: | |
on: | |
schedule: | |
# Run every Monday at 00:00 UTC | |
- cron: "0 0 * * 1" | |
pull_request: | |
paths: | |
- ".github/workflows/templating.yml" | |
workflow_dispatch: # Allow manual triggering |
I suppose this can be fairly similar to how we handle upstream Qiskit testing.
@@ -0,0 +1,32 @@ | |||
name: Templating |
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.
Yeah. That would be similar to how we are doing that for the MQT Core update workflow
In QCEC: https://github.com/munich-quantum-toolkit/qcec/blob/main/.github/workflows/update-mqt-core.yml
In the workflow repo: https://github.com/munich-quantum-toolkit/workflows/blob/main/.github/workflows/reusable-mqt-core-update.yml
Although I suppose that this will actually be an action instead of a workflow. So it might as well be that we do not add anything to the workflows repository.
.github/workflows/templating.yml
Outdated
- name: Commit and push changes | ||
run: | | ||
git add . | ||
if ! git diff --cached --quiet; then | ||
git commit -m "Update template" | ||
git push | ||
else | ||
echo "No changes to commit." | ||
fi |
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.
This can be heavily inspired by https://github.com/munich-quantum-toolkit/workflows/blob/main/.github/workflows/reusable-mqt-core-update.yml
Especially when it comes to creating the PR.
That also means that this code snippet can be entirely moved to the reusable workflow/action.
Description
This PR adds a workflow that uses an action introduced in munich-quantum-toolkit/templates#1 to synchronize files across repositories.
Checklist:
I have added appropriate tests that cover the new/changed functionality.I have updated the documentation to reflect these changes.I have added entries to the changelog for any noteworthy additions, changes, fixes or removals.I have added migration instructions to the upgrade guide (if needed).