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.41-2-g01ccd8c
_commit: v0.0.41-10-g38b62f8
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: Copier template for creating Python libraries and executables
python_ci_versions:
Expand Down
45 changes: 45 additions & 0 deletions .github/actions/update-devcontainer-hash/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update Devcontainer Hash

inputs:
branch:
description: 'Branch to checkout and update'
required: true

permissions:
contents: write


runs:
using: composite
steps:
- name: Verify Dependabot actor
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
echo "Action can only be run by dependabot[bot], but was invoked by ${GITHUB_ACTOR}." >&2
exit 1

- name: Checkout code
uses: actions/checkout@v4.2.2
with:
persist-credentials: true
fetch-depth: 1
ref: ${{ inputs.branch }}

- name: Configure Git author
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Update devcontainer hash
run: |
python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero

- name: Commit & push changes
run: |
if ! git diff --quiet; then
git add .
git commit -m "chore: update devcontainer hash [dependabot skip]"
git push origin HEAD:${{ inputs.branch }}
else
echo "No changes to commit"
fi
13 changes: 12 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches-ignore:
- 'gh-readonly-queue/**' # don't run (again) when on these special branches created during merge groups; the `on: merge_group` already triggers it.
merge_group:
workflow_dispatch:

env:
PYTHONUNBUFFERED: True
Expand All @@ -16,7 +15,17 @@ permissions:
contents: write # needed for mutex

jobs:
get-values:
runs-on: ubuntu-24.04
steps:
- name: Update Devcontainer Hash
if: ${{ github.actor == 'dependabot[bot]' }}
uses: ./.github/actions/update-devcontainer-hash
with:
branch: ${{ github.ref_name }}

pre-commit:
needs: [ get-values ]
strategy:
fail-fast: false
matrix:
Expand All @@ -29,6 +38,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
ref: ${{ github.ref_name }} # explicitly get the head of



Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/dependabot-post-update.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions template/.github/actions/update-devcontainer-hash/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update Devcontainer Hash

inputs:
branch:
description: 'Branch to checkout and update'
required: true

permissions:
contents: write


runs:
using: composite
steps:
- name: Verify Dependabot actor
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
echo "Action can only be run by dependabot[bot], but was invoked by ${GITHUB_ACTOR}." >&2
exit 1

- name: Checkout code
uses: actions/checkout@v4.2.2
with:
persist-credentials: true
fetch-depth: 1
ref: ${{ inputs.branch }}

- name: Configure Git author
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Update devcontainer hash
run: |
python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero

- name: Commit & push changes
run: |
if ! git diff --quiet; then
git add .
git commit -m "chore: update devcontainer hash [dependabot skip]"
git push origin HEAD:${{ inputs.branch }}
else
echo "No changes to commit"
fi
Comment on lines +1 to +45
Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A composite action 'Update Devcontainer Hash' is defined in both 'template/.github/actions/update-devcontainer-hash/action.yml' and '.github/actions/update-devcontainer-hash/action.yml'. Consider consolidating these into a single source to reduce duplication and ease maintenance.

Suggested change
name: Update Devcontainer Hash
inputs:
branch:
description: 'Branch to checkout and update'
required: true
permissions:
contents: write
runs:
using: composite
steps:
- name: Verify Dependabot actor
if: ${{ github.actor != 'dependabot[bot]' }}
run: |
echo "Action can only be run by dependabot[bot], but was invoked by ${GITHUB_ACTOR}." >&2
exit 1
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
persist-credentials: true
fetch-depth: 1
ref: ${{ inputs.branch }}
- name: Configure Git author
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Update devcontainer hash
run: |
python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero
- name: Commit & push changes
run: |
if ! git diff --quiet; then
git add .
git commit -m "chore: update devcontainer hash [dependabot skip]"
git push origin HEAD:${{ inputs.branch }}
else
echo "No changes to commit"
fi
# File removed to consolidate the composite action into a single source.

Copilot uses AI. Check for mistakes.
59 changes: 0 additions & 59 deletions template/.github/workflows/dependabot-post-update.yaml

This file was deleted.