Skip to content

👷 Add create release workflow#6565

Merged
dubzzz merged 12 commits into
mainfrom
copilot/add-changelog-action
Feb 8, 2026
Merged

👷 Add create release workflow#6565
dubzzz merged 12 commits into
mainfrom
copilot/add-changelog-action

Conversation

Copilot AI commented Feb 7, 2026

Copy link
Copy Markdown
Contributor
  • Create the changelog extraction script at .github/workflows/scripts/extract-changelog.cjs
  • Create GitHub Actions workflow .github/workflows/create-release.yml
  • Add packageDir parameter to extractLatestChangelog() to support any package sub-directory
  • Use __dirname for path resolution
  • Extract the release name (tag line) from the changelog
  • Return the git tag name (v<version> for fast-check, <packageDir>/v<version> for others)
  • Use explicit value checks instead of truthy/falsy
  • Switch to workflow_dispatch trigger with package choice input
  • Create GitHub releases using softprops/action-gh-release instead of posting PR comments
  • Mark fast-check releases as latest, others as not latest
  • Configure the action to create the tag
  • Rename workflow file from pr-changelog.yml to create-release.yml
  • Use release name for the GitHub release name field
  • Exclude release name line from the changelog body
  • Add dry_run boolean input to skip release creation
  • Print extracted values (version, tag, release name, changelog) in console
  • Run prettier formatter
Original prompt

create a GitHub action executed at each pr targeting main and printing in a comment on the pr the changelog for the last version of fast-check along with the version at the top shown within a message such as 'changelog for version xxx:'. for the extraction of the changelog makes the code as simple as scanning the changelog file line per line until finding the start of another release note. extract this script into a dedicated file that you'll store next to the action itself


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@changeset-bot

changeset-bot Bot commented Feb 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fad6e32

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Add GitHub action for printing fast-check changelog 👷 Add PR changelog comment workflow Feb 7, 2026
Copilot AI requested a review from dubzzz February 7, 2026 20:59
* Scans the CHANGELOG.md file line by line until finding the start of another release note.
* @returns {{version: string, changelog: string}}
*/
function extractLatestChangelog() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add a parameter to this function to specify the sub-directory where to take the changelog from. It could be fast-check, but also ava or any of the others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a packageDir parameter to extractLatestChangelog() — it now takes the sub-directory name (e.g. 'fast-check', 'ava', 'jest') and reads packages/<packageDir>/CHANGELOG.md. Commit: 6d902a3.

Comment thread .github/workflows/pr-changelog.yml Outdated

on:
pull_request:
types: [opened]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot it should be reexecuted whenever the pr gets updated. Use the same trigger as other actions based on pr trigger

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the trigger to types: [opened, edited, reopened, synchronize] matching the pattern used by validate-pr-title.yml. Commit: 6d902a3.

@pkg-pr-new

pkg-pr-new Bot commented Feb 7, 2026

Copy link
Copy Markdown
@fast-check/ava

npm i https://pkg.pr.new/@fast-check/ava@6565

fast-check

npm i https://pkg.pr.new/fast-check@6565

@fast-check/jest

npm i https://pkg.pr.new/@fast-check/jest@6565

@fast-check/packaged

npm i https://pkg.pr.new/@fast-check/packaged@6565

@fast-check/poisoning

npm i https://pkg.pr.new/@fast-check/poisoning@6565

@fast-check/vitest

npm i https://pkg.pr.new/@fast-check/vitest@6565

@fast-check/worker

npm i https://pkg.pr.new/@fast-check/worker@6565

commit: fad6e32

@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

Copilot AI requested a review from dubzzz February 7, 2026 21:05
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

Changelog for version 4.5.3:

Proper attestation file naming
[Code][Diff]

Fixes

  • (PR#6421) CI: Rename attestation bundles to *.sigstore.json

* @returns {{version: string, changelog: string}}
*/
function extractLatestChangelog(packageDir) {
const changelogPath = path.join(process.env.GITHUB_WORKSPACE || process.cwd(), 'packages', packageDir, 'CHANGELOG.md');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use dirname instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to __dirname for path resolution: path.join(__dirname, '..', '..', '..', 'packages', packageDir, 'CHANGELOG.md'). Commit: 2078bc5.

changelogLines.pop();
}

return { version, changelog: changelogLines.join('\n') };

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Extract the name of the release or tag line too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now extracting the release name (italic tag line like _Proper attestation file naming_) into a releaseName field. The return type is now {version, releaseName, changelog}. Commit: 2078bc5.

Copilot AI requested a review from dubzzz February 7, 2026 21:14
@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

changelogLines.pop();
}

return { version, releaseName, changelog: changelogLines.join('\n') };

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot also return the tag name of such version, check how we named version in the past. fast-check does it differently from others but others use the same pattern

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a computeTagName helper and a tag field to the return value. fast-check uses v<version>, others use <packageDir>/v<version> — matching the convention in generate-changelog.cjs. Commit: e2c8985.

}
if (foundFirst) {
const releaseNameMatch = line.match(/^_(.+)_$/);
if (releaseNameMatch && !releaseName) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot only use if(abc) or if(!abc) if abc is a boolean value, otherwise clearly specify the value you check for (null? undefined? 0? Empty string?)

Applies the guideline for the whole file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated all checks to use explicit comparisons: foundFirst === true, releaseNameMatch !== null, releaseName === ''. Commit: e2c8985.

Comment thread .github/workflows/scripts/extract-changelog.cjs
Copilot AI requested a review from dubzzz February 7, 2026 21:21
@dubzzz

dubzzz commented Feb 7, 2026

Copy link
Copy Markdown
Owner

@copilot change the trigger of the workflow..it should not be on pull request but manually triggered with something like:

on:
workflow_dispatch:
inputs:
package:
description: 'Package to release'
required: true
type: choice
options:
- fast-check
- ava
- jest
- vitest
- worker
- poisoning
- packaged

Instead of printing a comment, create a new release using the action we already use in another action. Make suer to mark fast-check releases as latest while for the others dont toggle on latest. Make sure you configure the action to create the tag as it will be missing when the action will run and this is the role of this action to create it

Copilot AI requested a review from dubzzz February 7, 2026 21:47
if (releaseNameMatch !== null && releaseName === '') {
releaseName = releaseNameMatch[1];
}
changelogLines.push(line);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot put it in a else so that we don't put the release name in the changelog

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved changelogLines.push(line) into an else branch so the release name line is excluded from the changelog body. Commit: 4267afc.

Copilot AI requested a review from dubzzz February 7, 2026 21:49
Comment thread .github/workflows/create-release.yml
Comment thread .github/workflows/create-release.yml
core.setOutput('tag', tag);
core.setOutput('release_name', releaseName);
core.setOutput('changelog', changelog);
- name: Create GitHub Release

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add a dry run boolean value that could be checked to avoid running the creation of the release

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a dry_run boolean input (default: false). When set to true, the release creation step is skipped via an if condition, while the changelog extraction still runs so you can verify the outputs. Commit: 224151d.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot in dry run print the values you extracted via the script in the condole (maybe always print them)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added console.log calls that always print the extracted version, tag, release name, and changelog — visible in both normal and dry run mode. Commit: fad6e32.

Copilot AI requested a review from dubzzz February 8, 2026 22:00
@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

@dubzzz
dubzzz marked this pull request as ready for review February 8, 2026 22:14
@dubzzz
dubzzz enabled auto-merge (squash) February 8, 2026 22:15
@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

@dubzzz
dubzzz merged commit 489196d into main Feb 8, 2026
50 checks passed
@dubzzz
dubzzz deleted the copilot/add-changelog-action branch February 8, 2026 22:21
@codecov

codecov Bot commented Feb 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.84%. Comparing base (7016469) to head (fad6e32).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6565      +/-   ##
==========================================
- Coverage   94.85%   94.84%   -0.02%     
==========================================
  Files         207      207              
  Lines        5581     5585       +4     
  Branches     1468     1470       +2     
==========================================
+ Hits         5294     5297       +3     
- Misses        274      275       +1     
  Partials       13       13              
Flag Coverage Δ
tests 94.84% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants