[r5n-83] actions command#7
Conversation
R5N-83 [SIS] `actions` command
This command will create workflows that use baked-in actions for example:
Automated Release PR Creation (like changesets/action) Merging the PR triggers the actual release Also it could make actions that:
Sisyphus GitHub Actions Release FlowOverviewAutomated release workflow using GitHub Actions with a two-stage process: Release PR(prepares changes) and Publish (releases to npm/GitHub). Directory StructureFlow1. PR Merges → Stone CreatedWhen a PR merges to main, the
2. Stone Pushed → Release PR Created/UpdatedWhen stones are pushed to main, the
3. Release PR Merges → PublishWhen the release PR merges, the
Config:
|
Add `sis actions init` and `sis actions release-pr` commands for automating releases via GitHub Actions. Includes PR skip configuration and shared logic refactoring (Stone.mergeAll, Package.applyStone).
createRelease Introduce provider abstraction layer to support GitHub, GitLab, and Bitbucket. Currently only GitHub is implemented; GitLab and Bitbucket are stubbed with "not supported yet" errors. - Add GitProvider abstract class with PR, label, and release operations - Add GitHubProvider implementation using gh CLI - Add factory function to detect provider from git remote - Rename --github flag to --createRelease for provider-agnostic naming - Update config, types, and init prompts accordingly
285c87a to
55ba5da
Compare
publish-only mode
Use pkg.version as fallback when pkg.newVersion is undefined (packages created via withVersion() don't have bump set). Add pushTags() method to push tags before creating GitHub releases in publish-only flow.
61a5853 to
face1fe
Compare
issues gh pr create uses GraphQL which fails with GITHUB_TOKEN in Actions. The REST API works reliably with standard token permissions.
--all selects all workflows, --yes only skips confirmation prompts. Non-interactive mode now requires explicit workflow selection.
operations Remove .quiet() from git and gh commands in release-pr and createPr so errors are visible when operations fail.
Prevents failures when bun.lock or other untracked files exist.
86253da to
f61cbcf
Compare
Add git fetch --unshallow for full history, manual trigger support, and fix skip logic to avoid running unnecessary commands.
When analyzing a merged PR, detect the merge method by checking if the merge commit has 1 parent (squash) or 2 parents (merge). For squash merges, create a synthetic commit from the PR title and fetch files from the API. For merge commits, extract the original commits from the merge ancestry.
Show each stone as a separate section with heading and description. Always show Stones section regardless of count.
format Show only relevant stones in each package's GitHub release notes. Wrap stones in a collapsible section with nested commits.
Add packageHeader and rootHeader config options for changelog headers.
- packageHeader: "{emoji} {version} ({date})" with {emoji}, {version},
{date}
- rootHeader: "{date} - {packages}" with {date}, {packages} placeholders
Apply configured author and email to git commits using --author flag.
Add support for filtering commits during changelog analysis based on author names and message patterns. This prevents automated commits (bots, release commits) from appearing in changelogs.
The release-pr command now automatically analyzes conventional commits and generates stones before creating the release PR. Extracted buildStoneData to CommitAnalyzer as a shared static method.
The PR body now displays individual commits under each stone section instead of only showing the description.
Prevents duplicate stone generation by tracking the newest processed commit. Also respects dry-run mode when generating stones.
generated ones Moves lastStone update to applyReleaseChanges so it considers all stones being released (both PR-created and commit-generated).
Stones were being generated before checkout, causing them to be lost. Decompose execute method for readability.
|
|
||
| await this.commitAndPushChanges(ctx, stones, packages); | ||
| await this.createOrUpdatePr(prTitle, prBody); | ||
| await Bun.$`git checkout ${baseBranch}`; |
There was a problem hiding this comment.
Thinking of wrapping all of those git actions into some own module but not sure if that's the time :)
There was a problem hiding this comment.
Felt like there's no need to do that for the universal ones, but it might me useful later to have the logic in one place. Could do that alongside the plugins/modules support PR
| case "bitbucket": | ||
| return new BitbucketProvider(info); |
There was a problem hiding this comment.
We should always add default and throw/log
Use early continue in loops, computed properties, destructuring spread, and default cases in switch statements.
- Replace hardcoded values with named constants (UNKNOWN_AUTHOR, DEFAULT_VERSION, DEFAULT_NPM_TAG, DEFAULT_BRANCH, etc.) - Refactor Stone constructor from 6 positional args to options object - Decompose long methods in release-pr.ts (buildPrBody, applyReleaseChanges) - Add typed API response interfaces for GitHub and GitLab providers - Remove inline type assertions in favor of proper type definitions
Summary
Add
sis actionscommand for CI/CD automation and cross-platform git provider support (GitHub + GitLab).New Commands
sis actions init- Generate CI workflows for automated releases--allflagcreate-stone- Auto-create stone when PR is merged, then create/update release PRrelease- Publish packages when release PR is merged.github/workflows/.gitlab-ci-sisyphus.ymlwith include directive instructionssis actions release-pr- Create or update a release PR from pending stonessisyphus/releasebranch with version bumps and changelogsreleased/<timestamp>/directorysisyphus-releaselabelcurrentReleaseconfig for publish-only modesis roll --publishOnly- Publish from prepared release (no file changes)currentReleaseconfigcurrentReleaseafter successful publishGitProvider Abstraction
GitProviderbase class with implementations for:GitHubProvider- FullghCLI integration (PRs, labels, releases)GitLabProvider- FullglabCLI integration (MRs, labels, releases)BitbucketProvider- Stub (not yet implemented)detectProvider()based on remote URLr5n-bot[bot]for CI operationsSkip Rules
pr.skip- Skip stone creation for specific PRs:labels- Skip PRs with specific labels (default:sisyphus-release,skip-stone)authors- Skip PRs by specific authors (default:r5n-bot[bot])titlePatterns- Skip PRs matching title regex (default:^chore\(release\):)commits.skip- Skip commits when auto-generating stones:authors- Skip commits by specific authors (default:r5n-bot[bot])messagePatterns- Skip commits matching regex (default:^chore\(release\):,^chore: add stone)Changelog Improvements
packageHeaderandrootHeadertemplatesBug Fixes
sis prnow correctly detects affected packages.quiet())Breaking Changes
release.github→release.createReleasesis roll --github→sis roll --createRelease/-rNew Domain Helpers
Stone.mergeAll()- Merge multiple stones into oneStone.fromJson()- Deserialize archived stonesPackage.applyStone()- Apply stone bumps to packagesPackage.withVersions()- Set old/new versions explicitlyCommit.fromHash()- Fetch single commit by hashCommit.fromMerge()- Get commits from a merge commitCommitAnalyzer.buildStoneData()- Convert commit group to stone data