-
Notifications
You must be signed in to change notification settings - Fork 0
ci(dependabot): prevent python version drift & auto-orchestrate updates #5
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
Changes from 3 commits
5be8ab5
cf83ed2
9fc6684
b43c890
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,14 +13,24 @@ jobs: | |||||||||||||
| unit-tests: | ||||||||||||||
| name: Run unit tests | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| outputs: | ||||||||||||||
| python-version: ${{ steps.get-version.outputs.version }} | ||||||||||||||
| steps: | ||||||||||||||
| - name: Check out repository | ||||||||||||||
| uses: actions/checkout@v6 | ||||||||||||||
|
|
||||||||||||||
| - name: Get Python version from Dockerfile | ||||||||||||||
| id: get-version | ||||||||||||||
| run: | | ||||||||||||||
| # Extract version like "3.14" from "FROM python:3.14-slim..." | ||||||||||||||
| VERSION=$(grep -m 1 "^FROM python:" Dockerfile | sed -E 's/^FROM python:([0-9]+\.[0-9]+).*/\1/') | ||||||||||||||
|
||||||||||||||
| VERSION=$(grep -m 1 "^FROM python:" Dockerfile | sed -E 's/^FROM python:([0-9]+\.[0-9]+).*/\1/') | |
| VERSION=$(grep -m 1 "^FROM python:" Dockerfile | sed -E 's/^FROM python:([0-9]+\.[0-9]+).*/\1/') | |
| if [ -z "$VERSION" ]; then | |
| echo "Error: Failed to extract Python version from Dockerfile. Expected a line like 'FROM python:<major>.<minor>-...'" >&2 | |
| exit 1 | |
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Dependabot Automerge | ||
| on: pull_request | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
||
|
|
||
| jobs: | ||
| automerge: | ||
| runs-on: ubuntu-latest | ||
| if: github.actor == 'dependabot[bot]' | ||
| steps: | ||
| - name: Enable automerge for Dependabot PRs | ||
| run: gh pr merge --auto --merge "$PR_URL" | ||
| env: | ||
| PR_URL: ${{ github.event.pull_request.html_url }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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.
unit-tests.outputs.python-versionis defined but not consumed by any downstream job/workflow. If nothing uses this output, consider removing it to avoid confusion (or add a consumer vianeeds.unit-tests.outputs.python-version).