alunduil / alunduil/blog.alunduil.com

Three workflows now repeat the same site-build setup

未关闭
#495 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Astro
星标
1
派生
1
平均合并
6 小时 34 分钟
30 天内合并 PR
118

描述

## Summary

`astro.yml`, `pages.yml` and `weekly.yml` each carry the same two things: an annotated `NODE_VERSION` env pin and a `withastro/action` step reading it.

```
- uses: withastro/action@e84f40bd8d2caa9e768ec82ad30dd81f0b280853 # v6
with:
node-version: ${{ env.NODE_VERSION }}
```

Two of those predate #483, which added the third while building the site for the weekly link scan. Three copies is where it stops being a coincidence.

## Cost

A Node bump is three edits, and the `# renovate:` annotation is duplicated alongside, so Renovate raises it three times rather than once. The action SHA is pinned in three places too, and any future build input — an env var the build needs, a cache step — lands in each.

## Options

- A composite action under `.github/actions/build-site/`, holding the version pin and the build step. Each workflow becomes a single `uses:`. Cheapest to read, and the pin lives once.
- A reusable workflow (`workflow_call`). More machinery than this needs — the shared part is two steps, not a job.
- Leave it. Defensible if the three are expected to drift apart; nothing suggests they are.

First option looks right. Deliberately not folded into #483: it edits `astro.yml` and `pages.yml`, which that PR has no business touching.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。