Uh oh!
There was an error while loading. Please reload this page.
DEVOPS-1218: Improvements to the dependabot PRs for .pre-commit-hooks. (Auto-merge, skip jira issue key, and run .pre-commit on all files) - #222
Conversation
There was a problem hiding this comment.
Pull request overview
Improves automation around Dependabot PRs that bump the .pre-commit-hooks group by ensuring pre-commit runs appropriately, Jira key enforcement is skipped for expected bot PRs, and eligible Dependabot PRs can be auto-merged.
Changes:
- Update reusable pre-commit workflow to run
pre-commiton all files for Dependabotpre-commit-hooksbumps. - Extend Jira PR actions workflow to exempt Dependabot
pre-commit-hooksPRs from requiring a Jira issue key. - Expand Dependabot auto-merge workflow to allow multiple Dependabot groups and add group validation logic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/reusable-pre_commit.yml | Adds conditional logic to run pre-commit on all files for Dependabot pre-commit-hooks PRs. |
| .github/workflows/reusable-jira-pr_actions.yml | Adds Dependabot pre-commit-hooks exemption path for Jira key enforcement. |
| .github/workflows/reusable-dependabot-auto-merge.yml | Renames/expands inputs to allow multiple groups and validates group membership before auto-merge. |
| .github/workflows/pre-commit.yml | Adds clarification comments for PR trigger scope supporting required checks for auto-merge. |
| .github/workflows/dependabot-auto-merge.yml | Switches to calling the local reusable auto-merge workflow and passes multiple allowed groups. |
Suppressed comments (1)
.github/workflows/reusable-pre_commit.yml:91
- Same as above: use a path-segment match for the Dependabot group to avoid accidentally treating other branches as
pre-commit-hooksbumps.
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.head_ref, 'pre-commit-hooks') }}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| IFS=',' read -ra groups <<< "$GROUPS" | ||
| for group in "${groups[@]}"; do | ||
| group=$(echo "$group" | xargs) | ||
| if [ -n "$group" ] && echo "$HEAD_REF" | grep -q "/${group}"; then | ||
| allowed=true |
| call-workflow-dependabot-auto-merge: | ||
| uses: MiraGeoscience/CI-tools/.github/workflows/reusable-dependabot-auto-merge.yml@3ff92aeffa5b92d646abea073ed5ad06117e57f6 # v3.11.0 | ||
| uses: ./.github/workflows/reusable-dependabot-auto-merge.yml | ||
| permissions: |
Uh oh!
There was an error while loading. Please reload this page.
| key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
| - name: Run pre-commit on modified files | ||
| if: ${{ (github.event_name == 'pull_request') }} | ||
| if: ${{ github.event_name == 'pull_request' && !(github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.head_ref, 'pre-commit-hooks')) }} |
- Add IS_DEPENDABOT_PRECOMMIT exemption in reusable JIRA PR checks. - Convert reusable-dependabot-auto-merge to accept a list of groups. - Pass mirageo-ci-tools and pre-commit-hooks groups from caller. - Run all pre-commit hooks on Dependabot pre-commit-hooks PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DEVOPS-1218 - Improvements to the dependabot PRs for .pre-commit-hooks. (Auto-merge, skip jira issue key, and run .pre-commit on all files)