Compare commits

...

9 Commits
v2.6.0 ... v3

Author SHA1 Message Date
Copilot
b430933298 release: cut v3.0.0 for Node 24 upgrade (#670)
- feat: move action runtime to node24 and require Node >=24
- chore: bump @types/node, enable Dependabot updates, rebuild dist
- cut 3.0.0 release

Signed-off-by: Rui Chen <rui@chenrui.dev>
2026-04-12 00:45:48 -04:00
dependabot[bot]
c2e35e05a7 chore(deps): bump the npm group across 1 directory with 7 updates (#783)
* chore(deps): bump the npm group across 1 directory with 7 updates

Bumps the npm group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) | `9.0.0` | `9.1.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.19.37` | `20.19.39` |
| [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) | `4.1.0` | `4.1.4` |
| [esbuild](https://github.com/evanw/esbuild) | `0.27.4` | `0.28.0` |
| [prettier](https://github.com/prettier/prettier) | `3.8.1` | `3.8.2` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.9.3` | `6.0.2` |



Updates `@actions/github` from 9.0.0 to 9.1.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

Updates `@types/node` from 20.19.37 to 20.19.39
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@vitest/coverage-v8` from 4.1.0 to 4.1.4
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.4/packages/coverage-v8)

Updates `esbuild` from 0.27.4 to 0.28.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.27.4...v0.28.0)

Updates `prettier` from 3.8.1 to 3.8.2
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.8.1...3.8.2)

Updates `typescript` from 5.9.3 to 6.0.2
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.3...v6.0.2)

Updates `vitest` from 4.1.0 to 4.1.4
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.4/packages/vitest)

---
updated-dependencies:
- dependency-name: "@actions/github"
  dependency-version: 9.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@types/node"
  dependency-version: 20.19.39
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@vitest/coverage-v8"
  dependency-version: 4.1.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: esbuild
  dependency-version: 0.28.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: prettier
  dependency-version: 3.8.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: typescript
  dependency-version: 6.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: npm
- dependency-name: vitest
  dependency-version: 4.1.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci: comment on stale dist bundles

Signed-off-by: Rui Chen <rui@chenrui.dev>

* update dist/index.js

Signed-off-by: Rui Chen <rui@chenrui.dev>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rui Chen <rui@chenrui.dev>
2026-04-11 23:55:00 -04:00
Rui Chen
3bb12739c2 release 2.6.2
Signed-off-by: Rui Chen <rui@chenrui.dev>
2026-04-11 23:31:51 -04:00
Rui Chen
c34030fec9 chore: bump node to 24.14.1
Signed-off-by: Rui Chen <rui@chenrui.dev>
2026-04-11 23:27:31 -04:00
dependabot[bot]
8975bd05c0 chore(deps): bump vite from 8.0.0 to 8.0.5 (#781)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 8.0.0 to 8.0.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.0.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 8.0.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-11 23:22:58 -04:00
dependabot[bot]
f71937f44d chore(deps): bump brace-expansion from 5.0.4 to 5.0.5 (#777)
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 5.0.4 to 5.0.5.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v5.0.4...v5.0.5)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 5.0.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-11 23:22:21 -04:00
dependabot[bot]
3f0d239d58 chore(deps): bump picomatch from 4.0.3 to 4.0.4 (#775)
Bumps [picomatch](https://github.com/micromatch/picomatch) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/picomatch/compare/4.0.3...4.0.4)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-11 23:22:10 -04:00
Rui Chen
153bb8e044 release 2.6.1
Signed-off-by: Rui Chen <rui@chenrui.dev>
2026-03-15 20:57:00 -04:00
Rui Chen
569deb874d fix: preserve discussion category when publishing releases (#765)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2026-03-15 20:54:29 -04:00
12 changed files with 546 additions and 354 deletions

View File

@@ -12,9 +12,6 @@ updates:
- dependency-name: node-fetch
versions:
- ">=3.0.0"
- dependency-name: "@types/node"
versions:
- ">=22.0.0"
commit-message:
prefix: "chore(deps)"
- package-ecosystem: github-actions

View File

@@ -4,6 +4,11 @@ on:
push:
pull_request:
permissions:
contents: read
issues: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-24.04
@@ -20,10 +25,49 @@ jobs:
- name: Build
run: npm run build
- name: Check dist freshness
id: dist_freshness
continue-on-error: true
run: |
git diff --exit-code --stat -- dist/index.js \
|| (echo "##[error] found changed dist/index.js after build. please run 'npm run build' and commit the updated bundle" \
&& exit 1)
- name: Comment on stale dist bundle
if: github.event_name == 'pull_request' && steps.dist_freshness.outcome == 'failure'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
marker='<!-- dist-freshness-check -->'
diff_stat="$(git diff --stat -- dist/index.js)"
body=$(cat <<EOF
$marker
\`dist/index.js\` changed after \`npm run build\`.
Please run \`npm run build\` and commit the regenerated bundle.
\`\`\`text
$diff_stat
\`\`\`
EOF
)
existing_id="$(
gh api "repos/$GH_REPO/issues/$PR_NUMBER/comments" \
--jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains("<!-- dist-freshness-check -->"))) | .id' \
| tail -n 1
)"
if [ -n "$existing_id" ]; then
gh api --method PATCH "repos/$GH_REPO/issues/comments/$existing_id" -f body="$body" >/dev/null
else
gh api --method POST "repos/$GH_REPO/issues/$PR_NUMBER/comments" -f body="$body" >/dev/null
fi
- name: Fail on stale dist bundle
if: steps.dist_freshness.outcome == 'failure'
run: |
echo "##[error] found changed dist/index.js after build. please run 'npm run build' and commit the updated bundle"
exit 1
- name: Test
run: npm run test
- name: Format

View File

@@ -1 +1 @@
nodejs 24.11.0
nodejs 24.14.1

View File

@@ -1,3 +1,42 @@
## 3.0.0
`3.0.0` is a major release that moves the action runtime from Node 20 to Node 24.
Use `v3` on GitHub-hosted runners and self-hosted fleets that already support the
Node 24 Actions runtime. If you still need the last Node 20-compatible line, stay on
`v2.6.2`.
## What's Changed
### Other Changes 🔄
* Move the action runtime and bundle target to Node 24
* Update `@types/node` to the Node 24 line and allow future Dependabot updates
* Keep the floating major tag on `v3`; `v2` remains pinned to the latest `2.x` release
## 2.6.2
## What's Changed
### Other Changes 🔄
* chore(deps): bump picomatch from 4.0.3 to 4.0.4 by @dependabot[bot] in https://github.com/softprops/action-gh-release/pull/775
* chore(deps): bump brace-expansion from 5.0.4 to 5.0.5 by @dependabot[bot] in https://github.com/softprops/action-gh-release/pull/777
* chore(deps): bump vite from 8.0.0 to 8.0.5 by @dependabot[bot] in https://github.com/softprops/action-gh-release/pull/781
## 2.6.1
`2.6.1` is a patch release focused on restoring linked discussion thread creation when
`discussion_category_name` is set. It fixes `#764`, where the draft-first publish flow
stopped carrying the discussion category through the final publish step.
If you still hit an issue after upgrading, please open a report with the bug template and include a minimal repro or sanitized workflow snippet where possible.
## What's Changed
### Bug fixes 🐛
* fix: preserve discussion category on publish by @chenrui333 in https://github.com/softprops/action-gh-release/pull/765
## 2.6.0
`2.6.0` is a minor release centered on `previous_tag` support for `generate_release_notes`,

View File

@@ -39,6 +39,9 @@ Typically usage of this action involves adding a step to a build that
is gated pushes to git tags. You may find `step.if` field helpful in accomplishing this
as it maximizes the reuse value of your workflow for non-tag pushes.
`v3` requires a GitHub Actions runtime that supports Node 24. If you still need the
last Node 20-compatible line, stay on `v2.6.2`.
Below is a simple example of `step.if` tag gating
```yaml
@@ -53,7 +56,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
if: github.ref_type == 'tag'
```
@@ -74,7 +77,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
```
### ⬆️ Uploading release assets
@@ -105,7 +108,7 @@ jobs:
- name: Test
run: cat Release.txt
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
if: github.ref_type == 'tag'
with:
files: Release.txt
@@ -129,7 +132,7 @@ jobs:
- name: Test
run: cat Release.txt
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
if: github.ref_type == 'tag'
with:
files: |
@@ -146,7 +149,7 @@ and keep the `files` patterns relative to that directory.
```yaml
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
if: github.ref_type == 'tag'
with:
working_directory: dist
@@ -175,7 +178,7 @@ jobs:
- name: Generate Changelog
run: echo "# Good things have arrived" > ${{ github.workspace }}-CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
if: github.ref_type == 'tag'
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
@@ -193,7 +196,7 @@ comparison range does not match the release series you want to publish.
```yaml
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: stage-2026-03-15
target_commitish: ${{ github.sha }}

View File

@@ -22,13 +22,14 @@ Use this checklist when cutting a new `action-gh-release` release.
- `npm run build`
- `npm test`
5. Commit the release prep.
- Use a plain release commit message like `release 2.5.4`.
- Use a plain release commit message like `release 3.0.0`.
6. Create the annotated tag for the release commit.
- Example: `git tag -a v2.5.4 -m "v2.5.4"`
- Example: `git tag -a v3.0.0 -m "v3.0.0"`
7. Push the commit and tag.
- Example: `git push origin master && git push origin v2.5.4`
- Example: `git push origin master && git push origin v3.0.0`
8. Move the floating major tag to the new release tag.
- For the current major line, either run `npm run updatetag` or update the script first if the major ever changes.
- For the current major line, run `npm run updatetag` to move `v3`.
- Keep `v2` pinned to the latest `2.x` release for consumers that still need the Node 20 runtime.
- Verify the floating tag points at the same commit as the new full tag.
9. Create the GitHub release from the new tag.
- Prefer the release body from [CHANGELOG.md](CHANGELOG.md), then let GitHub append generated notes only if they add value.

View File

@@ -226,6 +226,64 @@ describe('github', () => {
);
expect(createRelease.mock.calls[0][0]).not.toHaveProperty('previous_tag_name');
});
it('passes discussion_category_name when finalizing a release', async () => {
const updateRelease = vi.fn(async () => ({
data: {
id: 1,
upload_url: 'test',
html_url: 'test',
tag_name: 'v1.0.0',
name: 'v1.0.0',
body: 'test',
target_commitish: 'main',
draft: false,
prerelease: false,
assets: [],
},
}));
const releaser = new GitHubReleaser({
rest: {
repos: {
generateReleaseNotes: vi.fn(),
createRelease: vi.fn(),
updateRelease,
getReleaseByTag: vi.fn(),
listReleaseAssets: vi.fn(),
deleteReleaseAsset: vi.fn(),
deleteRelease: vi.fn(),
updateReleaseAsset: vi.fn(),
listReleases: {
endpoint: {
merge: vi.fn(),
},
},
},
},
paginate: {
iterator: vi.fn(),
},
request: vi.fn(),
} as any);
await releaser.finalizeRelease({
owner: 'owner',
repo: 'repo',
release_id: 1,
make_latest: 'legacy',
discussion_category_name: 'Announcements',
});
expect(updateRelease).toHaveBeenCalledWith({
owner: 'owner',
repo: 'repo',
release_id: 1,
draft: false,
make_latest: 'legacy',
discussion_category_name: 'Announcements',
});
});
});
describe('finalizeRelease input_draft behavior', () => {
@@ -309,10 +367,49 @@ describe('github', () => {
owner: 'owner',
repo: 'repo',
release_id: release.id,
make_latest: undefined,
discussion_category_name: undefined,
});
}
});
it('passes discussion_category_name through when finalizing a draft release', async () => {
const finalizeReleaseSpy = vi.fn(async () => ({ data: finalizedRelease }));
const releaser: Releaser = {
getReleaseByTag: () => Promise.reject('Not implemented'),
createRelease: () => Promise.reject('Not implemented'),
updateRelease: () => Promise.reject('Not implemented'),
finalizeRelease: finalizeReleaseSpy,
allReleases: async function* () {
throw new Error('Not implemented');
},
listReleaseAssets: () => Promise.reject('Not implemented'),
deleteReleaseAsset: () => Promise.reject('Not implemented'),
deleteRelease: () => Promise.reject('Not implemented'),
updateReleaseAsset: () => Promise.reject('Not implemented'),
uploadReleaseAsset: () => Promise.reject('Not implemented'),
};
await finalizeRelease(
{
...config,
input_draft: false,
input_discussion_category_name: 'Announcements',
},
releaser,
draftRelease,
);
expect(finalizeReleaseSpy).toHaveBeenCalledWith({
owner: 'owner',
repo: 'repo',
release_id: draftRelease.id,
make_latest: undefined,
discussion_category_name: 'Announcements',
});
});
it('deletes a newly created draft when tag creation is blocked by repository rules', async () => {
const finalizeReleaseSpy = vi.fn(async () => {
throw {

View File

@@ -75,7 +75,7 @@ outputs:
assets:
description: "JSON array containing information about each uploaded asset, in the format given [here](https://docs.github.com/en/rest/reference/repos#upload-a-release-asset--code-samples) (minus the `uploader` field)"
runs:
using: "node20"
using: "node24"
main: "dist/index.js"
branding:
color: "green"

38
dist/index.js vendored

File diff suppressed because one or more lines are too long

620
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +1,17 @@
{
"name": "action-gh-release",
"version": "2.6.0",
"version": "3.0.0",
"private": true,
"description": "GitHub Action for creating GitHub Releases",
"main": "lib/main.js",
"scripts": {
"build": "esbuild src/main.ts --bundle --platform=node --format=cjs --target=node20 --outfile=dist/index.js --minify",
"build-debug": "esbuild src/main.ts --bundle --platform=node --format=cjs --target=node20 --outfile=dist/index.js --sourcemap --keep-names",
"build": "esbuild src/main.ts --bundle --platform=node --format=cjs --target=node24 --outfile=dist/index.js --minify",
"build-debug": "esbuild src/main.ts --bundle --platform=node --format=cjs --target=node24 --outfile=dist/index.js --sourcemap --keep-names",
"typecheck": "tsc --noEmit",
"test": "vitest --coverage",
"fmt": "prettier --write \"src/**/*.ts\" \"__tests__/**/*.ts\"",
"fmtcheck": "prettier --check \"src/**/*.ts\" \"__tests__/**/*.ts\"",
"updatetag": "git tag -d v2 && git push origin :v2 && git tag -a v2 -m '' && git push origin v2"
"updatetag": "git tag -d v3 >/dev/null 2>&1 || true; git push origin :v3 >/dev/null 2>&1 || true; git tag -a v3 -m '' && git push origin v3"
},
"repository": {
"type": "git",
@@ -21,9 +21,12 @@
"actions"
],
"author": "softprops",
"engines": {
"node": ">=24"
},
"dependencies": {
"@actions/core": "^3.0.0",
"@actions/github": "^9.0.0",
"@actions/github": "^9.1.0",
"@octokit/plugin-retry": "^8.1.0",
"@octokit/plugin-throttling": "^11.0.3",
"glob": "^13.0.6",
@@ -32,12 +35,12 @@
"devDependencies": {
"@types/glob": "^9.0.0",
"@types/mime-types": "^3.0.1",
"@types/node": "^20.19.37",
"@vitest/coverage-v8": "^4.1.0",
"esbuild": "^0.27.3",
"prettier": "3.8.1",
"@types/node": "^24",
"@vitest/coverage-v8": "^4.1.4",
"esbuild": "^0.28.0",
"prettier": "3.8.2",
"ts-node": "^10.9.2",
"typescript": "^5.9.3",
"typescript": "^6.0.2",
"typescript-formatter": "^7.2.2",
"vitest": "^4.0.4"
}

View File

@@ -71,6 +71,7 @@ export interface Releaser {
repo: string;
release_id: number;
make_latest: 'true' | 'false' | 'legacy' | undefined;
discussion_category_name: string | undefined;
}): Promise<{ data: Release }>;
allReleases(params: { owner: string; repo: string }): AsyncIterable<{ data: Release[] }>;
@@ -181,6 +182,7 @@ export class GitHubReleaser implements Releaser {
repo: string;
release_id: number;
make_latest: 'true' | 'false' | 'legacy' | undefined;
discussion_category_name: string | undefined;
}) {
return await this.github.rest.repos.updateRelease({
owner: params.owner,
@@ -188,6 +190,7 @@ export class GitHubReleaser implements Releaser {
release_id: params.release_id,
draft: false,
make_latest: params.make_latest,
discussion_category_name: params.discussion_category_name,
});
}
@@ -364,7 +367,7 @@ export const upload = async (
size,
mime,
token: config.github_token,
data: fh.readableWebStream({ type: 'bytes' }),
data: fh.readableWebStream(),
});
} finally {
await fh.close();
@@ -641,6 +644,7 @@ export const finalizeRelease = async (
repo,
release_id: release.id,
make_latest: config.input_make_latest,
discussion_category_name: config.input_discussion_category_name,
});
return data;