Skip to content

feat(workflows): add reusable Docusaurus workflow (DX-2760)#1398

Open
sebawo wants to merge 13 commits intomainfrom
convert-docs-actions-to-reusable-workflows
Open

feat(workflows): add reusable Docusaurus workflow (DX-2760)#1398
sebawo wants to merge 13 commits intomainfrom
convert-docs-actions-to-reusable-workflows

Conversation

@sebawo
Copy link
Collaborator

@sebawo sebawo commented Jan 30, 2026

Add a single reusable workflow for Docusaurus documentation: build, test (optional), and deploy to GitHub Pages. Remove the former composite actions in favor of the workflow only.

Changes

Added

  • reusable-docusaurus.yml – One reusable workflow with one job (docusaurus): checkout, setup Node.js (pinned ref), build docs, (optional) run tests, upload pages artifact, deploy to GitHub Pages. Build runs once; no duplicate jobs.

Callers use one workflow_call to run build, test, and deploy in a single job.

Security

  • Pin smartcontractkit/.github/actions/setup-nodejs to commit hash (setup-nodejs@0.2.3) to satisfy CodeQL unpinned-action requirement.

Removed

  • actions/docs-test/ – Composite action removed; use reusable workflow instead.
  • actions/docs-deploy/ – Composite action removed; use reusable workflow instead.
  • .changeset/docs-actions-minor.md – No longer versioning the removed actions.

Other

  • pnpm-lock.yaml – Dropped actions/docs-test and actions/docs-deploy from lockfile.

Convert docs-test and docs-deploy composite actions to reusable workflows
for consistency with other .github workflows.
@sebawo sebawo requested a review from a team as a code owner January 30, 2026 16:52
@github-actions
Copy link
Contributor

👋 sebawo, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

…cusaurus

Single reusable workflow with two jobs: docs-test (build + test) and
docs-deploy (build + deploy to GitHub Pages). Deploy runs after test succeeds.
Remove reusable-docs-test.yml and reusable-docs-deploy.yml.
@sebawo sebawo changed the title feat(workflows): add reusable docs-test and docs-deploy workflows feat(workflows): add reusable Docusaurus workflow Jan 30, 2026
Pin smartcontractkit/.github/actions/setup-nodejs to commit hash
(43fe7fd) to resolve CodeQL unpinned-action warning.
Co-authored-by: chainchad <96362174+chainchad@users.noreply.github.com>
chainchad
chainchad previously approved these changes Jan 30, 2026
@chainchad chainchad enabled auto-merge (squash) January 30, 2026 18:20
sebawo and others added 5 commits January 31, 2026 14:53
Remove actions/docs-test and actions/docs-deploy; Docusaurus build/test
and deploy is now only via reusable-docusaurus.yml workflow. Remove
docs-actions-minor changeset and update pnpm-lock.yaml.
Build once, then run test (if set), upload pages artifact, and deploy.
Removes duplicate build and second job (docs-deploy).
Co-authored-by: chainchad <96362174+chainchad@users.noreply.github.com>
- reusable-docusaurus: add job-level permissions (contents, pages, id-token)
  and header comment documenting required permissions; no workflow-level perms
- pull-request-main: add workflow-permissions-check job to fail when
  reusable workflows have non-empty workflow-level permissions
@chainchad chainchad force-pushed the convert-docs-actions-to-reusable-workflows branch from e4a32e6 to 4575245 Compare January 31, 2026 19:59
- uses: actions/checkout@v6

- name: Setup nodejs
uses: smartcontractkit/.github/actions/setup-nodejs@setup-nodejs/v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Reusable Docusaurus' step
Uses Step
uses 'smartcontractkit/.github/actions/setup-nodejs' with ref 'setup-nodejs/v1', not a pinned commit hash
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chainchad we need to write the custom config to skip those findings for internal actions.

@sebawo sebawo changed the title feat(workflows): add reusable Docusaurus workflow feat(workflows): add reusable Docusaurus workflow (DX-2760) Feb 2, 2026
sebawo and others added 4 commits February 6, 2026 12:42
…rectory with pnpm -C

Co-authored-by: Cursor <cursoragent@cursor.com>
…g validates docs)

Co-authored-by: Cursor <cursoragent@cursor.com>
…ain)

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve modify/delete conflicts: keep removal of actions/docs-deploy and
actions/docs-test (replaced by reusable workflow).

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines +68 to +72
deployment-branch:
description: "branch to deploy to (e.g., gh-pages)"
required: false
type: string
default: "gh-pages"
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused.

Comment on lines +58 to +67
github-event-name:
description: "the GitHub event name that triggered the calling workflow (e.g., push, pull_request, merge_group)"
required: false
type: string
default: "workflow_call"
github-ref:
description: "the GitHub ref that triggered the calling workflow (e.g., refs/heads/main)"
required: false
type: string
default: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe these are already available from the original calling context. So they aren't needed as inputs.

For example: https://github.com/smartcontractkit/releng-test/actions/runs/21961260549/job/63439049182?pr=159

# https://github.com/smartcontractkit/releng-test/actions/runs/21961366180/job/63439420326#step:3:44
GITHUB_REF=refs/heads/main

# https://github.com/smartcontractkit/releng-test/actions/runs/21961366180/job/63439420326#step:3:91
GITHUB_REF_NAME=main

# https://github.com/smartcontractkit/releng-test/actions/runs/21961366180/job/63439420326#step:3:61
GITHUB_EVENT_NAME=push

These are accessible as env vars or like:

  • ${{ github.event_name }}
  • ${{ github.ref_name }}
  • etc...

uses: actions/upload-pages-artifact@v4.0.0
with:
path: >-
${{ inputs.package-json-directory }}/${{ inputs.build-output-directory }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should include package-json-directory.

The path can be relative to the repository root as the other inputs, or can be an absolute path if they are outputting to /tmp for example.

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.

3 participants