Skip to content

feat: distribute deploy workflow as reusable GitHub Actions workflow#799

Open
dqn wants to merge 7 commits intomainfrom
feat/reusable-deploy-workflow
Open

feat: distribute deploy workflow as reusable GitHub Actions workflow#799
dqn wants to merge 7 commits intomainfrom
feat/reusable-deploy-workflow

Conversation

@dqn
Copy link
Contributor

@dqn dqn commented Mar 21, 2026

Distribute the deploy workflow as a reusable GitHub Actions workflow, replacing locally generated composite actions.

Usage

Caller workflow generated by setup github:

jobs:
  deploy:
    uses: tailor-platform/sdk/.github/workflows/deploy.yml@actions/v1
    with:
      workspace-name: my-app
      workspace-region: asia-northeast
      organization-id: "org-123"
      folder-id: "folder-456"
    secrets:
      PLATFORM_MACHINE_USER_CLIENT_ID: ${{ secrets.PLATFORM_MACHINE_USER_CLIENT_ID }}
      PLATFORM_MACHINE_USER_CLIENT_SECRET: ${{ secrets.PLATFORM_MACHINE_USER_CLIENT_SECRET }}

Main Changes

  • Add .github/workflows/deploy.yml reusable workflow with all deployment logic inlined (node/pnpm setup, OAuth2 token fetch, workspace provisioning, generate, deploy)
  • Add .github/workflows/release-actions.yml for managing actions/vX tag namespace independently from SDK semver tags (manual workflow_dispatch trigger with dry-run support)
  • Simplify setup github output from 3 files (2 composite actions + 1 workflow) to 1 thin caller workflow
  • Remove Renovate customManagers for composite action YAMLs (reusable workflow is covered by built-in github-actions manager)

Notes

  • The reusable workflow supports working-directory, node-version, and pnpm-version inputs for monorepo and version flexibility
  • Initial actions/v1.0.0 + actions/v1 tags should be created via release-actions.yml after merge
  • No impact on users who already ran setup github (existing files are skipped)

Open with Devin

dqn added 2 commits March 22, 2026 03:02
Replace locally generated composite actions (install-node,
fetch-tailor-token) with a reusable workflow at
.github/workflows/deploy.yml. The setup github command now generates
a single thin caller workflow that references the reusable workflow
via uses: tailor-platform/sdk/.github/workflows/deploy.yml@actions/v1.

Add release-actions.yml workflow for managing the actions/ tag
namespace independently from SDK semver tags.

Remove the Renovate customManagers entry for composite action YAML
files since the reusable workflow is covered by the built-in
github-actions manager.
@changeset-bot
Copy link

changeset-bot bot commented Mar 21, 2026

🦋 Changeset detected

Latest commit: 23899e4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Minor
@tailor-platform/create-sdk Minor

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tailor-platform/create-sdk@799

commit: 23899e4

@github-actions

This comment has been minimized.

Required by ghalint policies (job_permissions, job_timeout_minutes_is_required).
@github-actions

This comment has been minimized.

dqn added 3 commits March 22, 2026 03:27
…flows

Remove persist-credentials: false from release-actions.yml checkout so
git push can authenticate when pushing tags. Change cache-dependency-path
in deploy.yml to use root pnpm-lock.yaml instead of working-directory
prefix, since pnpm workspaces keep the lockfile at the repo root.
Add a step that rejects release-actions.yml runs from non-main branches
to prevent accidentally publishing actions/v1 from feature branches.
Add a comment in the deploy template explaining the separate release
process for the @actions/v1 ref.
@dqn dqn marked this pull request as ready for review March 21, 2026 19:16
@dqn dqn requested review from remiposo and toiroakr as code owners March 21, 2026 19:16
@github-actions

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as resolved.

@claude
Copy link

claude bot commented Mar 21, 2026

📖 Docs Consistency Check

No inconsistencies found between documentation and implementation.

Checked Areas

CLI Documentation (packages/sdk/docs/cli/setup.md, packages/sdk/docs/cli-reference.md)

  • ✅ Command description and options match implementation
  • ✅ Docs don't specify file count or structure (appropriately generic)

Configuration & Guides (CLAUDE.md, docs/, examples)

  • ✅ No references to composite actions or specific GitHub Actions implementation details
  • ✅ No examples in example/ directory to update

Environment Variables (packages/sdk/docs/cli-reference.md:63-64)

  • PLATFORM_MACHINE_USER_CLIENT_ID and PLATFORM_MACHINE_USER_CLIENT_SECRET documented
  • ✅ Match the secrets required by the new reusable workflow

Implementation & Tests

  • ✅ Tests updated to verify single-file output (github.test.ts:21-27)
  • ✅ Tests verify reusable workflow reference (github.test.ts:31-33)
  • ✅ File skipping behavior preserved for backward compatibility

Changeset

  • ✅ Correctly describes change as minor (backward compatible)
  • ✅ Accurately states "Distribute deploy workflow as a reusable GitHub Actions workflow"

Summary of Changes in PR #799

Before: setup github generated 3 files:

  • .github/workflows/deploy-{workspace}.yml (inline steps)
  • .github/actions/install-node/action.yml (composite action)
  • .github/actions/fetch-tailor-token/action.yml (composite action)

After: setup github generates 1 file:

  • .github/workflows/deploy-{workspace}.yml (thin caller to tailor-platform/sdk/.github/workflows/deploy.yml@actions/v1)

Impact: This is an internal implementation detail. The docs appropriately avoid specifying file count/structure, so no updates are needed. Users who previously ran setup github are unaffected (existing files are skipped).


…ase-actions

- Add persist-credentials: false to Checkout step (ghalint policy 013)
- Configure token-based push via remote URL for tag pushing
- Move all ${{ }} expressions to env variables to prevent script injection
@github-actions
Copy link

Code Metrics Report (packages/sdk)

main (cca1f43) #799 (532d4b5) +/-
Coverage 55.8% 55.8% 0.0%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Details
  |                    | main (cca1f43) | #799 (532d4b5) | +/-  |
  |--------------------|----------------|----------------|------|
  | Coverage           |          55.8% |          55.8% | 0.0% |
  |   Files            |            322 |            318 |   -4 |
  |   Lines            |          10386 |          10386 |    0 |
  |   Covered          |           5797 |           5797 |    0 |
+ | Code to Test Ratio |          1:0.4 |          1:0.4 | +0.0 |
  |   Code             |          60871 |          60853 |  -18 |
- |   Test             |          24680 |          24676 |   -4 |

Code coverage of files in pull request scope (60.6% → 60.6%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/setup/github/deploy.workflow.yml 0.0% 0.0% modified
packages/sdk/src/cli/commands/setup/github/fetch-tailor-token.action.yml 0.0% 0.0% removed
packages/sdk/src/cli/commands/setup/github/github.ts 48.0% 0.0% modified
packages/sdk/src/cli/commands/setup/github/install-node.action.yml 0.0% 0.0% removed
packages/sdk/src/cli/commands/setup/github/template-deploy.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/setup/github/template-fetch-tailor-token.ts 0.0% 0.0% removed
packages/sdk/src/cli/commands/setup/github/template-install-node.ts 0.0% 0.0% removed
packages/sdk/src/cli/commands/setup/github/templates.ts 0.0% 0.0% modified

SDK Configure Bundle Size

main (cca1f43) #799 (532d4b5) +/-
configure-index-size 10.74KB 10.74KB 0KB
dependency-chunks-size 34KB 34KB 0KB
total-bundle-size 44.74KB 44.74KB 0KB

Runtime Performance

main (cca1f43) #799 (532d4b5) +/-
Generate Median 2,626ms 2,561ms -65ms
Generate Max 2,799ms 2,582ms -217ms
Apply Build Median 2,683ms 2,591ms -92ms
Apply Build Max 2,715ms 2,619ms -96ms

Type Performance (instantiations)

main (cca1f43) #799 (532d4b5) +/-
tailordb-basic 43,028 43,028 0
tailordb-optional 3,927 3,927 0
tailordb-relation 4,071 4,071 0
tailordb-validate 2,925 2,925 0
tailordb-hooks 5,790 5,790 0
tailordb-object 11,571 11,571 0
tailordb-enum 2,793 2,793 0
resolver-basic 9,239 9,239 0
resolver-nested 25,626 25,626 0
resolver-array 17,862 17,862 0
executor-schedule 4,244 4,244 0
executor-webhook 883 883 0
executor-record 4,847 4,847 0
executor-resolver 4,273 4,273 0
executor-operation-function 877 877 0
executor-operation-gql 879 879 0
executor-operation-webhook 898 898 0
executor-operation-workflow 2,290 2,290 0

Reported by octocov

run: pnpm tailor-sdk show -j -w "$TAILOR_PLATFORM_WORKSPACE_ID"
# The @actions/v1 ref is published separately via the "Release Actions" workflow
# (release-actions.yml) in the tailor-platform/sdk repository.
uses: tailor-platform/sdk/.github/workflows/deploy.yml@actions/v1
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be a bit of a hassle, but would it be possible to change the pattern to place action.yaml in the root of the repository?
I would like to be able to write it in the format: uses: tailor-platform/sdk/@${version}.

The implementation of https://github.com/csm-actions/securefix-action might be a helpful reference.

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