Skip to content

Commit 448efee

Browse files
authored
Add content on using immutable releases in actions release management (#57299)
1 parent b92625a commit 448efee

File tree

4 files changed

+50
-15
lines changed

4 files changed

+50
-15
lines changed

content/actions/how-tos/create-and-publish-actions/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ children:
1616
- /set-exit-codes
1717
- /publish-in-github-marketplace
1818
- /release-and-maintain-actions
19+
- /using-immutable-releases-and-tags-to-manage-your-actions-releases
1920
---
20-

content/actions/how-tos/create-and-publish-actions/manage-custom-actions.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ To ensure that your action is compatible with other platforms, do not use any ha
4242

4343
## Using release management for actions
4444

45-
This section explains how you can use release management to distribute updates to your actions in a predictable way.
46-
47-
### Good practices for release management
48-
4945
If you're developing an action for other people to use, we recommend using release management to control how you distribute updates. Users can expect an action's patch version to include necessary critical fixes and security patches, while still remaining compatible with their existing workflows. You should consider releasing a new major version whenever your changes affect compatibility.
5046

5147
Under this release management approach, users should not be referencing an action's default branch, as it's likely to contain the latest code and consequently might be unstable. Instead, you can recommend that your users specify a major version when using your action, and only direct them to a more specific version if they encounter issues.
@@ -54,20 +50,20 @@ To use a specific action version, users can configure their {% data variables.pr
5450

5551
### Using tags for release management
5652

57-
We recommend using tags for actions release management. Using this approach, your users can easily distinguish between major and minor versions:
53+
{% ifversion immutable-releases-preview %}
54+
> [!NOTE] If you have enabled immutable releases to help prevent supply chain attacks and accidental changes to your releases, instead see [AUTOTITLE](/actions/how-tos/create-and-publish-actions/using-immutable-releases-and-tags-to-manage-your-actions-releases).
55+
{% endif %}
5856

59-
1. Create and validate a release on a release branch (such as `release/v1`) before creating the release tag (for example, `v1.0.2`).
60-
1. Create a release using semantic versioning. For more information, see [AUTOTITLE](/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
61-
1. Move the major version tag (such as `v1`, `v2`) to point to the Git ref of the current release. For more information, see [Git basics - tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
57+
We recommend using tags for actions release management. Using this approach, your users can easily distinguish between major and minor versions:
6258

63-
{% ifversion immutable-releases-preview %}
64-
> [!NOTE]
65-
> If you enable immutable releases, you can still move Git tags that are not linked to releases on {% data variables.product.github %}.
66-
{% endif %}
59+
1. Develop and validate a release on a release branch (for example, `release/v1`).
60+
1. Create a release with a release tag using semantic versioning (for example, `v1.0.1`). For more information, see [AUTOTITLE](/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
61+
1. Move the major version tag (for example, `v1`) to point to the Git ref of the current release. For more information, see [Git basics - tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
62+
1. Introduce a new major version tag (for example, `v2`) for changes that will break existing workflows, such as changing an action's inputs.
6763

68-
1. Introduce a new major version tag (`v2`) for changes that will break existing workflows. For example, changing an action's inputs would be a breaking change.
64+
#### Syntax for referencing tags
6965

70-
This example demonstrates how a user can reference a major release tag:
66+
This example demonstrates how a user can reference a major version tag:
7167

7268
```yaml
7369
steps:

content/actions/how-tos/create-and-publish-actions/release-and-maintain-actions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ To support the developer process in the next section, add two {% data variables.
5555
1. Add a workflow that triggers when a commit is pushed to a feature branch or to `main` or when a pull request is created. Configure the workflow to run your unit and integration tests. For an example, see [this workflow](https://github.com/actions/javascript-action/blob/main/.github/workflows/ci.yml).
5656
1. Add a workflow that triggers when a release is published or edited. Configure the workflow to ensure semantic tags are in place. You can use an action like [JasonEtco/build-and-tag-action](https://github.com/JasonEtco/build-and-tag-action) to compile and bundle the JavaScript and metadata file and force push semantic major, minor, and patch tags. For more information about semantic tags, see [About semantic versioning](https://docs.npmjs.com/about-semantic-versioning).
5757

58+
{% ifversion immutable-releases-preview %}
59+
> [!NOTE]
60+
> If you enable immutable releases for your repository, you cannot use this action to force push tags tied to releases on {% data variables.product.github %}. To learn how to manage your releases with immutable releases, see [AUTOTITLE](/actions/how-tos/create-and-publish-actions/using-immutable-releases-and-tags-to-manage-your-actions-releases).
61+
{% endif %}
62+
5863
### Example developer process
5964

6065
Here is an example process that you can follow to automatically run tests, create a release{% ifversion fpt or ghec %} and publish to {% data variables.product.prodname_marketplace %}{% endif %}, and publish your action.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Using immutable releases and tags to manage your action's releases
3+
shortTitle: Use immutable releases
4+
intro: 'Learn how you can use a combination of immutable releases on {% data variables.product.github %} and Git tags to manage your action''s releases.'
5+
versions:
6+
feature: immutable-releases-preview
7+
topics:
8+
- Actions
9+
- Code Security
10+
- Vulnerabilities
11+
- Dependencies
12+
---
13+
14+
{% data reusables.releases.immutable-releases-preview-note %}
15+
16+
If you enable immutable releases on your action's repository, you can manage your action's releases as follows:
17+
18+
1. To start the release cycle, develop and validate a potential release for your action on a release branch.
19+
1. Determine how you want to share your changes:
20+
* If you are ready to share an unchangeable version of your action, create a release on {% data variables.product.github %} with a release-specific tag (for example, `v1.0.0`). See [AUTOTITLE](/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release).
21+
* If you want to be able to update the Git tag of a release later, do not create a release on {% data variables.product.github %}. Instead, create a tag as follows:
22+
* If your release contains breaking changes for existing workflows, create a major version tag (for example, `v1`).
23+
* If your release contains new backwards-compatible functionality, create a minor version tag (for example, `v1.1`).
24+
* If your release contains backwards-compatible bug fixes, create a patch version tag (for example, `v1.1.1`).
25+
1. For Git tags that are not tied to a release on {% data variables.product.github %}, ensure users have access to the latest compatible version of your action by updating them as follows:
26+
* For a major version, update the tag to point to the Git ref of the latest related minor version or patch version.
27+
* For a minor version, update the tag to point to the Git ref of the latest related patch version.
28+
29+
To move an existing Git tag to the most recent commit, force push the tag with the following commands:
30+
31+
```bash copy
32+
git tag -f TAG-NAME
33+
git push -f --tags
34+
```

0 commit comments

Comments
 (0)