diff --git a/.github/workflows/template.yml b/.github/workflows/template.yml index 7bb55e1..9419a53 100644 --- a/.github/workflows/template.yml +++ b/.github/workflows/template.yml @@ -30,8 +30,7 @@ jobs: run: | just actionlint render-and-check: - # ubuntu-latest includes Node, which markdownlint-cli2 needs - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: contents: read steps: @@ -52,8 +51,8 @@ jobs: - name: Render a project and run its checks run: | just check - # Same markdownlint-cli2 version as the VS Code markdownlint extension + # Same action pin as the template's python.yml - name: Markdownlint - working-directory: _rendered/demo-project - run: | - npx --yes markdownlint-cli2@0.23.2 "**/*.md" + uses: DavidAnson/markdownlint-cli2-action@696eb3f2509270d7b882d2aa68347bc676e7af34 # v25.0.0 + with: + globs: _rendered/demo-project/**/*.md diff --git a/template/.github/workflows/python.yml.jinja b/template/.github/workflows/python.yml.jinja index c675335..897dacf 100644 --- a/template/.github/workflows/python.yml.jinja +++ b/template/.github/workflows/python.yml.jinja @@ -58,7 +58,7 @@ jobs: persist-credentials: false # Keep markdownlint-cli2 in step with the VS Code markdownlint extension - name: Markdownlint - uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0 + uses: DavidAnson/markdownlint-cli2-action@696eb3f2509270d7b882d2aa68347bc676e7af34 # v25.0.0 with: globs: "**/*.md" {%- endraw %} diff --git a/template/.github/workflows/release.yml b/template/.github/workflows/release.yml index d74ee47..85b93d5 100644 --- a/template/.github/workflows/release.yml +++ b/template/.github/workflows/release.yml @@ -42,12 +42,17 @@ jobs: id: commit env: TAG: ${{ steps.drafter.outputs.tag_name }} + GH_TOKEN: ${{ github.token }} run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add pyproject.toml uv.lock - git commit -m "Release $TAG" - git push origin main + # Skip the commit when pyproject.toml already has the release version + if ! git diff --quiet -- pyproject.toml uv.lock; then + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add pyproject.toml uv.lock + git commit -m "Release $TAG" + # Checkout doesn't persist credentials, so authenticate the push explicitly + git push "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main + fi echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - name: Publish release