Skip to content

Bump pip from 26.1.2 to 26.2 in /CI #37

Bump pip from 26.1.2 to 26.2 in /CI

Bump pip from 26.1.2 to 26.2 in /CI #37

name: Dependabot CI Updates
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
permissions:
contents: read
jobs:
dependabot-auto-approve:
name: Auto-approve and auto-merge safe Dependabot updates
runs-on: ubuntu-latest
if: >
github.event.pull_request.user.login == 'dependabot[bot]' &&
contains(github.event.pull_request.labels.*.name, 'dependencies')
permissions:
contents: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
disable-sudo: true
egress-policy: audit
- name: Fetch Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Stop workflow if not minor update or patch update
id: skip-condition
if: >
steps.dependabot-metadata.outputs.update-type != 'version-update:semver-minor' &&
steps.dependabot-metadata.outputs.update-type != 'version-update:semver-patch'
run: |
echo "Not a minor or patch update; skipping auto-approval."
echo "skip=true" >> $GITHUB_OUTPUT
- name: Checkout Repository
if: steps.skip-condition.outputs.skip != 'true'
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
- name: Approve Changes
if: steps.skip-condition.outputs.skip != 'true'
run: |
decision="$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)"
if [ "$decision" != "APPROVED" ]; then
gh pr review --approve "$PR_URL"
else
echo "PR already approved: skipping approval."
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
- name: Enable auto-merge (squash) on Pull Request
if: steps.skip-condition.outputs.skip != 'true'
run: |
gh pr merge --auto --squash "$PR_URL"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}