Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.0.40
_commit: v0.0.41
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: Copier template for creating Python libraries and executables
python_ci_versions:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/dependabot-post-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,30 @@ jobs:
run: python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero

- name: Commit & push changes
id: commit
run: |
# only commit if there are changes
if ! git diff --quiet; then
git add .
git commit -m "chore: apply post-Dependabot script changes [dependabot skip]"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
echo "pushed=true" >> $GITHUB_OUTPUT
else
echo "No changes to commit"
echo "pushed=false" >> $GITHUB_OUTPUT
fi

- name: Dispatch CI on PR branch # pushes done by GITHUB_TOKEN don't trigger workflows, so we have to restart the CI job manually, see https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
if: steps.commit.outputs.pushed == 'true'
uses: actions/github-script@v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const run = context.payload.workflow_run;
const pr = run.pull_requests[0];
const pr = context.payload.pull_request;
if (!pr) {
throw new Error("No pull request linked to this workflow_run event; aborting dispatch.");
throw new Error("No pull_request found in payload; aborting dispatch.");
}
await github.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "ci.yaml",
ref: run.head_branch,
ref: pr.head.ref,
});
17 changes: 9 additions & 8 deletions template/.github/workflows/dependabot-post-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,30 @@ jobs:
run: python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero

- name: Commit & push changes
id: commit
run: |
# only commit if there are changes
if ! git diff --quiet; then
git add .
git commit -m "chore: apply post-Dependabot script changes [dependabot skip]"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
echo "pushed=true" >> $GITHUB_OUTPUT
else
echo "No changes to commit"
echo "pushed=false" >> $GITHUB_OUTPUT
fi

- name: Dispatch CI on PR branch # pushes done by GITHUB_TOKEN don't trigger workflows, so we have to restart the CI job manually, see https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
if: steps.commit.outputs.pushed == 'true'
uses: actions/github-script@v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const run = context.payload.workflow_run;
const pr = run.pull_requests[0];
const pr = context.payload.pull_request;
if (!pr) {
throw new Error("No pull request linked to this workflow_run event; aborting dispatch.");
throw new Error("No pull_request found in payload; aborting dispatch.");
}
await github.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: "ci.yaml",
ref: run.head_branch,
ref: pr.head.ref,
});