Skip to content

Commit f7aeb09

Browse files
📈 Update versions for pre-commit hooks (#252)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
1 parent 9db6a2c commit f7aeb09

4 files changed

Lines changed: 35 additions & 32 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ updates:
77
interval: "daily"
88
cooldown:
99
default-days: 14
10-
ignore:
11-
# https://github.com/softprops/action-gh-release/issues/556
12-
- dependency-name: "softprops/action-gh-release"
13-
versions: ["2.2.0"]
1410
commit-message:
1511
prefix: "🦄 "
1612
include: scope

.github/workflows/cd.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CD
22

33
on:
44
workflow_dispatch:
5-
release:
6-
types:
7-
- published
5+
push:
6+
tags:
7+
- "v*"
88
schedule:
99
- cron: "0 0 * * 1"
1010

@@ -30,7 +30,7 @@ jobs:
3030

3131
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3232
with:
33-
python-version: 3.12
33+
python-version: 3.13
3434

3535
- name: Build source distribution
3636
run: pipx run build --sdist --outdir dist/
@@ -432,7 +432,7 @@ jobs:
432432
contents: write # Required to upload signed artifacts to a GitHub release
433433
attestations: write # Required to generate build provenance attestations
434434
runs-on: ubuntu-latest
435-
if: github.event_name == 'release' && github.event.action == 'published'
435+
if: startsWith(github.ref, 'refs/tags/')
436436

437437
steps:
438438
- name: Download all artifacts
@@ -442,7 +442,6 @@ jobs:
442442
merge-multiple: true
443443

444444
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
445-
if: github.event_name == 'release' && github.event.action == 'published'
446445
with:
447446
# Comment this line out to publish to PyPI
448447
# repository-url: https://test.pypi.org/legacy/
@@ -462,12 +461,14 @@ jobs:
462461
upload/*.whl
463462
upload/*.tar.gz
464463
465-
- name: Publish to GitHub Releases
466-
# Wait for https://github.com/softprops/action-gh-release/issues/556 to be resolved
467-
# before bumping to v2.2.0.
468-
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
469-
if: github.event_name == 'release' && github.event.action == 'published'
470-
with:
471-
# This will contain not only the wheel and sdist, but also the signature files
472-
# generated by the Sigstore action
473-
files: upload/*
464+
- name: Create GitHub Release and upload artifacts
465+
env:
466+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
467+
run: |
468+
# Create a draft release and upload all artifacts (wheels, sdist, and
469+
# Sigstore signatures), then publish — the release becomes immutable
470+
# once it is no longer a draft
471+
gh release create "${GITHUB_REF_NAME}" upload/* \
472+
--draft \
473+
--generate-notes
474+
gh release edit "${GITHUB_REF_NAME}" --draft=false

.github/workflows/update-hugo.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,19 @@ jobs:
7979
8080
- name: Create pull request
8181
if: steps.check-hugo-release.outputs.updated == 'true'
82-
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
83-
with:
84-
branch: update-hugo-v${{ steps.check-hugo-release.outputs.latest_version }}
85-
commit-message: "Update Hugo to v${{ steps.check-hugo-release.outputs.latest_version }}"
86-
title: "Update Hugo to v${{ steps.check-hugo-release.outputs.latest_version }}"
87-
body-path: /tmp/pr-body.md
88-
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
89-
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
90-
reviewers: |
91-
agriyakhetarpal
82+
env:
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
LATEST_VERSION: ${{ steps.check-hugo-release.outputs.latest_version }}
85+
GITHUB_REPOSITORY: ${{ github.repository }}
86+
run: |
87+
git config user.name "github-actions[bot]"
88+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
89+
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY"
90+
git checkout -b "update-hugo-v${LATEST_VERSION}"
91+
git add setup.py src/hugo/cli.py hugo
92+
git commit -m "Update Hugo to v${LATEST_VERSION}"
93+
git push origin "update-hugo-v${LATEST_VERSION}"
94+
gh pr create \
95+
--title "Update Hugo to v${LATEST_VERSION}" \
96+
--body-file /tmp/pr-body.md \
97+
--reviewer agriyakhetarpal

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
- id: trailing-whitespace
1919

2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: "v0.15.4"
21+
rev: "v0.15.8"
2222
hooks:
2323
- id: ruff
2424
args: ["--fix", "--show-fixes"]
@@ -32,7 +32,7 @@ repos:
3232
- id: pyupgrade
3333

3434
- repo: https://github.com/codespell-project/codespell
35-
rev: "v2.4.1"
35+
rev: "v2.4.2"
3636
hooks:
3737
- id: codespell
3838
args: ["--skip=CODE_OF_CONDUCT.md"]
@@ -45,7 +45,7 @@ repos:
4545
args: [--prose-wrap=preserve]
4646

4747
- repo: https://github.com/woodruffw/zizmor-pre-commit
48-
rev: "v1.22.0"
48+
rev: "v1.23.1"
4949
hooks:
5050
- id: zizmor
5151
args: ["--pedantic"]

0 commit comments

Comments
 (0)