Skip to content

Commit 173de15

Browse files
chore(ci): regenerate the agent skill references in the release instead of after every docs merge (#8811)
1 parent d36ecdd commit 173de15

5 files changed

Lines changed: 26 additions & 61 deletions

File tree

‎.agents/skills/building-lambda-functions-with-powertools-python/references/idempotency.md‎

Lines changed: 18 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/agent_skill_references.yml‎

Lines changed: 0 additions & 52 deletions
This file was deleted.

‎.github/workflows/publish_v3_layer.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ jobs:
277277

278278
- name: Replace layer versions in documentation
279279
run: ./layer_v3/scripts/update_layer_arn_v3.sh ${{ inputs.layer_documentation_version }}
280+
# The agent skill references are generated from the docs; regenerate them here so the release PR carries both
281+
- name: Regenerate agent skill references
282+
run: python3 scripts/build_agent_skill_references.py
280283
# NOTE: It felt unnecessary creating yet another PR to update changelog w/ latest tag
281284
# since this is the only step in the release where we update docs from a temp branch
282285
- name: Update changelog with latest tag
@@ -285,7 +288,7 @@ jobs:
285288
id: create-pr
286289
uses: ./.github/actions/create-pr
287290
with:
288-
files: "docs/index.md docs/getting-started/install.md docs/includes/_layer_homepage_arm64.md docs/includes/_layer_homepage_x86.md examples CHANGELOG.md"
291+
files: "docs/index.md docs/getting-started/install.md docs/includes/_layer_homepage_arm64.md docs/includes/_layer_homepage_x86.md examples CHANGELOG.md .agents/skills/building-lambda-functions-with-powertools-python/references"
289292
temp_branch_prefix: "ci-layer-docs"
290293
pull_request_title: "chore(ci): layer docs update"
291294
github_token: ${{ secrets.GITHUB_TOKEN }}

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ make mypy # static typing, must pass
1818
uv run pytest tests/unit tests/functional/<utility> # fast loop for one utility
1919
make test # full unit + functional + performance, what CI runs
2020
make pr # everything CI checks, run it before opening the PR
21-
make agent-skill # optional: regenerate .agents/skills/*/references after changing docs/; pre-commit does it, and CI does it after merge
21+
make agent-skill # optional: regenerate .agents/skills/*/references after changing docs/; pre-commit does it, and the release does it
2222
```
2323

2424
Do not run the full suite with `pytest -n auto`; collection differs between workers and it fails for reasons unrelated to your change.
@@ -58,6 +58,6 @@ Do not run the full suite with `pytest -n auto`; collection differs between work
5858
| Sample events | `tests/events/` |
5959
| Docs and examples | `docs/<area>/<utility>.md`, `examples/<utility>/src/` |
6060
| Project premises | `docs/adr/` |
61-
| Agent skill for library users | `.agents/skills/` (the `references/` folder is generated from `docs/` by `scripts/build_agent_skill_references.py`, and regenerated by CI after every docs merge; do not edit it or use it as a source, change `docs/`) |
61+
| Agent skill for library users | `.agents/skills/` (the `references/` folder is generated from `docs/` by `scripts/build_agent_skill_references.py`, and regenerated on every release; do not edit it or use it as a source, change `docs/`) |
6262
| Layer build | `layer_v3/` |
6363
| Maintainer process | [MAINTAINERS.md](MAINTAINERS.md), [docs/maintainers.md](docs/maintainers.md) |

‎scripts/build_agent_skill_references.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
``--check`` to report whether the committed references are out of date.
77
88
Contributors do not need to run this: the pre-commit hook regenerates on docs changes for
9-
those who have it installed, and a workflow regenerates on every push to ``develop`` that
10-
touches the docs, opening a PR with the result.
9+
those who have it installed, and the release workflow regenerates the references in the same
10+
PR that updates the layer version in the docs.
1111
"""
1212

1313
from __future__ import annotations

0 commit comments

Comments
 (0)