Skip to content

Commit 41eb48c

Browse files
babblebeytravi
andauthored
refactor(recipe): improve github actions recipe (#16)
This PR revamps the GitHub Actions recipe page to be more action-oriented, easier to scan, and aligned with current semantic-release security guidance. ### Notable Changes - Reworked the page flow to be execution-first: 1. Quick start at the top 2. Clear publishing path selection 3. Minimal Node workflow users can copy and run 4. Deeper context and edge cases afterward - Improved navigation with direct links from quick start to relevant sections. - Added a practical pitfalls checklist and a release readiness checklist. - Modernized guidance around publishing/auth: 1. Prioritizes trusted publishing (OIDC) and npm provenance 2. Clarifies token behavior and setup expectations - Updated the commit-during-release guidance: 1. Recommends GitHub App authentication as the preferred approach 2. Adds a minimal GitHub App token example 3. Explicitly discourages PAT usage due to security risk - Added guidance that the workflow snippet represents a simple/default release flow and points users to the Running semantic-release docs for alternate invocation patterns and non-default setups. ## Screenshot/Screencast [screen-capture (68).webm](https://github.com/user-attachments/assets/f676ef37-6223-4305-bbf3-c748e42cbc72) --------- Co-authored-by: Matt Travi <126441+travi@users.noreply.github.com>
1 parent 9f9e27b commit 41eb48c

10 files changed

Lines changed: 317 additions & 169 deletions

File tree

astro.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ export default defineConfig({
7878
{
7979
label: "CI Configurations",
8080
items: [
81-
{ slug: "recipes/ci-configurations" },
82-
{ slug: "recipes/ci-configurations/circleci-workflows" },
83-
{ slug: "recipes/ci-configurations/travis" },
84-
{ slug: "recipes/ci-configurations/gitlab-ci" },
81+
{ slug: "recipes/ci-configurations", label: "Overview" },
8582
{ slug: "recipes/ci-configurations/github-actions" },
83+
{ slug: "recipes/ci-configurations/gitlab-ci" },
84+
{
85+
slug: "recipes/ci-configurations/circleci-workflows",
86+
label: "CircleCI Workflows",
87+
},
88+
{ slug: "recipes/ci-configurations/travis" },
8689
{ slug: "recipes/ci-configurations/jenkins-ci" },
8790
],
8891
},

src/content/docs/foundation/considerations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ title: Considerations
1212

1313
If your primary attraction is for automatic release note generation rather than semantic versioning, you may want to reconsider if **semantic-release** is the right fit for your goals.
1414

15-
:::tip[Recommendation]
15+
:::tip[Recommendation]
1616
Adopt **semantic-release** when semantic versioning is your primary objective, with release-step automation as a secondary benefit.
1717
:::
1818

@@ -29,7 +29,7 @@ Applications that are deployed directly to a runtime environment lack an audienc
2929
Docker images that are published to a registry only for the purpose of deploying directly to a runtime environment fall into this category, even though they are a published asset.
3030
Often, using the git SHA as the version for such assets is a better choice than versioning them semantically.
3131

32-
:::tip[Recommendation]
32+
:::tip[Recommendation]
3333
Prioritize semantic versioning for artifacts consumed as dependencies; for directly deployed artifacts, consider using git SHAs instead.
3434
:::
3535

@@ -43,7 +43,7 @@ and [making commits during the release process adds significant complexity](/sup
4343

4444
Please consider the trade-offs of adding those plugins to your release configuration for potentially unnecessary goals.
4545

46-
:::tip[Recommendation]
46+
:::tip[Recommendation]
4747
Keep your configuration minimal and only add release-time commits when there is a clear, justified need.
4848
:::
4949

src/content/docs/foundation/plugins.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ This enables support for different [commit message conventions](/foundation/how-
88

99
A plugin is a npm module that can implement one or more lifecycle methods for the following hooks:
1010

11-
| Lifecycle Hook | Related Release Step | Required | Description |
12-
| ------------------ | --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13-
| `verifyConditions` | Verify Conditions | No | Verify conditions necessary to proceed with the release: configuration is correct, authentication tokens are valid, and so on. |
14-
| `analyzeCommits` | Analyze Commits | Yes | Determine the type of the next release (`major`, `minor`, or `patch`). This hook is required to decide the next release type. If multiple plugins implement `analyzeCommits`, the highest release type returned wins. |
15-
| `verifyRelease` | Verify Release | No | Verify the parameters of the release that is about to be published, such as version, type, or distribution tag. |
16-
| `generateNotes` | Generate Notes | No | Generate the content of the release note. If multiple plugins implement `generateNotes`, the release notes will be the concatenation of each plugin output. |
17-
| `prepare` | Prepare | No | Prepare the release, for example by creating or updating files such as `package.json`, `CHANGELOG.md`, documentation, or compiled assets and pushing a commit. |
18-
| `publish` | Publish | No | Publish the release. |
19-
| `addChannel` | Add Channel (optional) | No | Assign the release to a distribution channel when channel management is needed, for example by adding an npm dist-tag. |
20-
| `success` | Notify | No | Notify consumers or maintainers after a successful release. |
21-
| `fail` | Notify | No | Notify consumers or maintainers after a failed release. |
11+
| Lifecycle Hook | Related Release Step | Required | Description |
12+
| ------------------ | ---------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13+
| `verifyConditions` | Verify Conditions | No | Verify conditions necessary to proceed with the release: configuration is correct, authentication tokens are valid, and so on. |
14+
| `analyzeCommits` | Analyze Commits | Yes | Determine the type of the next release (`major`, `minor`, or `patch`). This hook is required to decide the next release type. If multiple plugins implement `analyzeCommits`, the highest release type returned wins. |
15+
| `verifyRelease` | Verify Release | No | Verify the parameters of the release that is about to be published, such as version, type, or distribution tag. |
16+
| `generateNotes` | Generate Notes | No | Generate the content of the release note. If multiple plugins implement `generateNotes`, the release notes will be the concatenation of each plugin output. |
17+
| `prepare` | Prepare | No | Prepare the release, for example by creating or updating files such as `package.json`, `CHANGELOG.md`, documentation, or compiled assets and pushing a commit. |
18+
| `publish` | Publish | No | Publish the release. |
19+
| `addChannel` | Add Channel (optional) | No | Assign the release to a distribution channel when channel management is needed, for example by adding an npm dist-tag. |
20+
| `success` | Notify | No | Notify consumers or maintainers after a successful release. |
21+
| `fail` | Notify | No | Notify consumers or maintainers after a failed release. |
2222

2323
For each [release step](/foundation/steps/), **semantic-release** runs every plugin in the [`plugins` array](plugins.md#plugins-declaration-and-execution-order) that implements the hook for that step.
2424

src/content/docs/foundation/shareable-configurations.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ The shareable configurations to use can be set with the [extends](/usage/configu
1616

1717
```json
1818
{
19-
"extends": "@semantic-release/gitlab-config"
19+
"extends": "@semantic-release/gitlab-config"
2020
}
2121
```
2222

2323
For example, a project can extend a shared base config and still override its own branches locally:
2424

2525
```json
2626
{
27-
"extends": "@semantic-release/gitlab-config",
28-
"branches": ["main", "next"]
27+
"extends": "@semantic-release/gitlab-config",
28+
"branches": ["main", "next"]
2929
}
3030
```
3131

@@ -36,4 +36,3 @@ If multiple shareable configurations are defined, they are loaded in order. Loca
3636
See the [shareable configurations list](/extending/shareable-configurations-list) for official and community-maintained packages you can extend.
3737

3838
If you want to build your own shareable configuration, see [Shareable configuration development](/developer-guide/shareable-configuration/).
39-

src/content/docs/foundation/supported-branching.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Supported Branching Models
44

55
This page summarizes branching models that align well with **semantic-release** and those that are officially unsupported.
66

7-
:::tip[Recommendation]
7+
:::tip[Recommendation]
88
Default to workflows that keep changes flowing to a stable trunk quickly and continuously.
99
:::
1010

@@ -35,7 +35,7 @@ These models align with the delivery and release assumptions built into **semant
3535

3636
- [Continuous Deployment](https://trunkbaseddevelopment.com/continuous-delivery/#continuous-deployment)
3737

38-
:::tip[Recommendation]
38+
:::tip[Recommendation]
3939
Choose a trunk-based workflow that keeps branch lifetime short and integration frequent.
4040
:::
4141

@@ -44,7 +44,7 @@ Choose a trunk-based workflow that keeps branch lifetime short and integration f
4444
- [GitHub Docs: GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)
4545
- [GitHub Flow](https://githubflow.github.io/)
4646

47-
:::tip[Recommendation]
47+
:::tip[Recommendation]
4848
GitHub Flow is a practical fit when pull requests are short-lived and releases are frequent.
4949
:::
5050

@@ -73,15 +73,15 @@ While the [same reflection](https://nvie.com/posts/a-successful-git-branching-mo
7373
While some have found that the [Pre-release workflow](/foundation/workflow-configuration/#prerelease) enabled by **semantic-release** can be used to _simulate_ a git-flow-like workflow,
7474
it is also worth noting that this orchestration pattern is not an intended use case and requests for support when attempting to use it that way will be closed by our team.
7575

76-
:::tip[Recommendation]
76+
:::tip[Recommendation]
7777
Avoid Git flow-style long-lived branch orchestration when using **semantic-release**.
7878
:::
7979

8080
### Workflows that Release for Testing Before Promotion to a Stable Release
8181

8282
- [The Importance of a Local Build](https://trunkbaseddevelopment.com/styles/#the-importance-of-a-local-build)
8383

84-
:::tip[Recommendation]
84+
:::tip[Recommendation]
8585
Prefer workflows where confidence comes from CI quality signals, with production release as the promotion event.
8686
:::
8787

src/content/docs/foundation/workflow-configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ The type of the branch is automatically determined based on naming conventions a
2323

2424
## Branch Properties
2525

26-
| Property | Branch type | Description | Default |
27-
| ------------ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
28-
| `name` | All | **Required.** The Git branch holding the commits to analyze and the code to release. See [name](#name). | - The value itself if defined as a `String` or the matching branches name if defined as a glob. |
29-
| `channel` | All | The distribution channel on which to publish releases from this branch. Set to `false` to force the default distribution channel instead of using the default. See [channel](#channel). | `undefined` for the first release branch, the value of `name` for subsequent ones. |
26+
| Property | Branch type | Description | Default |
27+
| ------------ | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
28+
| `name` | All | **Required.** The Git branch holding the commits to analyze and the code to release. See [name](#name). | - The value itself if defined as a `String` or the matching branches name if defined as a glob. |
29+
| `channel` | All | The distribution channel on which to publish releases from this branch. Set to `false` to force the default distribution channel instead of using the default. See [channel](#channel). | `undefined` for the first release branch, the value of `name` for subsequent ones. |
3030
| `range` | [maintenance](#maintenance-branches) only | **Required unless `name` is formatted like `N.N.x` or `N.x` (`N` is a number).** The range of [semantic versions](https://semver.org) to support on this branch. See [range](#range). | The value of `name`. |
3131
| `prerelease` | [pre-release](#pre-release-branches) only | **Required.** The pre-release denotation to append to [semantic versions](https://semver.org) released from this branch. See [prerelease](#prerelease). | - |
3232

0 commit comments

Comments
 (0)