Skip to content

Commit f1861c1

Browse files
authored
ci: restore post-release workflow on 3.x (#16748)
# Overview Restores release notifications (PR/issue comments, website dispatch, Discord announcement) for Payload v3.x releases. ## Key Changes - **Port `post-release` workflow and `release-commenter` action to `3.x`** - Adds `.github/workflows/post-release.yml` and `.github/actions/release-commenter/` from `main`. - GitHub Actions resolves `release` event workflows from the release's `target_commitish` branch, not the repo default. Since v3.84.1, releases set `target_commitish: 3.x`, where neither file existed, so no workflow runs were queued. - **Differences vs. the version previously on `3.x` (removed in #16358)** - `release-commenter` action: identical. - `post-release.yml`: adds the `dispatch-to-website` job (sends `repository_dispatch` to `payloadcms/website`) and pins the Discord action to a SHA. Reviewers should confirm `dispatch-to-website` is desired for 3.x releases; if the website only expects events from `main`/v4, that job should be dropped before merging. ## Design Decisions Chose to reinstate original workflow. Drift risk: future edits to `post-release.yml` on `main` must be mirrored to `3.x`. ## Overall Flow ```mermaid sequenceDiagram participant Releaser as tools/releaser participant GH as GitHub participant WF as post-release.yml (3.x) participant Site as payloadcms/website participant Discord Releaser->>GH: Publish release (target_commitish=3.x) GH->>WF: Trigger release:published from 3.x branch WF->>GH: Comment on linked PRs/issues (release-commenter) WF->>Site: repository_dispatch payload-release-event WF->>Discord: Post to releases + general channels ```
1 parent 957a92e commit f1861c1

13 files changed

Lines changed: 39760 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
env: {
3+
es6: true,
4+
node: true,
5+
},
6+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended'],
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
ecmaVersion: 2018,
10+
sourceType: 'module',
11+
},
12+
plugins: ['@typescript-eslint'],
13+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
MIT License
2+
3+
Copyright (c) 2020-2025 Cameron Little <cameron@camlittle.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
'Software'), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23+
24+
---
25+
26+
Modifications made by Payload CMS, Inc. <info@payloadcms.com>, 2025
27+
Details in README.md
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Release Commenter
2+
3+
This GitHub Action automatically comments on and/or labels Issues and PRs when a fix is released for them.
4+
5+
> [!IMPORTANT]
6+
> 🔧 Heavily modified version of https://github.com/apexskier/github-release-commenter
7+
8+
## Fork Modifications
9+
10+
- Filters to closed PRs only
11+
- Adds tag filter to support non-linear releases
12+
- Better logging
13+
- Moved to pnpm
14+
- Uses @vercel/ncc for packaging
15+
- Comments on locked issues by unlocking then re-locking
16+
17+
## How it works
18+
19+
Use this action in a workflow [triggered by a release](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#release). It will scan commits between that and the prior release, find associated Issues and PRs, and comment on them to let people know a release has been made. Associated Issues and PRs can be directly [linked](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) to the commit or manually linked from a PR associated with the commit.
20+
21+
## Inputs
22+
23+
**GITHUB_TOKEN**
24+
25+
A GitHub personal access token with repo scope, such as [`secrets.GITHUB_TOKEN`](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#about-the-github_token-secret).
26+
27+
**comment-template** (optional)
28+
29+
Override the comment posted on Issues and PRs. Set to the empty string to disable commenting. Several variables strings will be automatically replaced:
30+
31+
- `{release_link}` - a markdown link to the release
32+
- `{release_name}` - the release's name
33+
- `{release_tag}` - the release's tag
34+
35+
**label-template** (optional)
36+
37+
Add the given label. Multiple labels can be separated by commas. Several variable strings will be automatically replaced:
38+
39+
- `{release_name}` - the release's name
40+
- `{release_tag}` - the release's tag
41+
42+
**skip-label** (optional)
43+
44+
Skip processing if any of the given labels are present. Same processing rules as **label-template**. Default is "dependencies".
45+
46+
## Example
47+
48+
```yml
49+
on:
50+
release:
51+
types: [published]
52+
53+
jobs:
54+
release:
55+
steps:
56+
- uses: apexskier/github-release-commenter@v1
57+
with:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
comment-template: |
60+
Release {release_link} addresses this.
61+
```
62+
63+
## Known limitations
64+
65+
These are some known limitations of this action. I'd like to try to address them in the future.
66+
67+
- Non-linear releases aren't supported. For example, releasing a patch to a prior major release after a new major release has been bumped.
68+
- Non-sequential releases aren't supported. For example, if you release multiple prereleases between two official releases, this will only create a comment for the first prerelease in which a fix is released, not the final release.
69+
- The first release for a project will be ignored. This is intentional, as the use case is unlikely. Most projects will either have several alphas that don't need release comments, or won't use issues/PRs for the first commit.
70+
- If a large number of things are commented on, you may see the error `Error: You have triggered an abuse detection mechanism. Please wait a few minutes before you try again.`. Consider using the `skip-label` input to reduce your load on the GitHub API.
71+
72+
## Versions
73+
74+
Workflows will automatically update the tags `v1` and `latest`, allowing you to reference one of those instead of locking to a specific release.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Commenter
2+
description: Comment on PRs and Issues when a fix is released
3+
branding:
4+
icon: message-square
5+
color: blue
6+
inputs:
7+
GITHUB_TOKEN:
8+
description: |
9+
A GitHub personal access token with repo scope, such as
10+
secrets.GITHUB_TOKEN.
11+
required: true
12+
comment-template:
13+
description: |
14+
Text template for the comment string.
15+
required: false
16+
default: |
17+
Included in release {release_link}
18+
label-template:
19+
description: Add the given label. Multiple labels can be separated by commas.
20+
required: false
21+
skip-label:
22+
description: Skip commenting if any of the given label are present. Multiple labels can be separated by commas.
23+
required: false
24+
default: 'dependencies'
25+
tag-filter:
26+
description: |
27+
Filter tags by a regular expression. Must be escaped. e.g. 'v\\d' to isolate tags between major versions.
28+
required: false
29+
default: null
30+
runs:
31+
using: node20
32+
main: dist/index.js

0 commit comments

Comments
 (0)