Skip to content

ci: extract Configure Site URL step into composite action#382

Open
sakinaroufid wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
sakinaroufid:refactor/extract-configure-site-url-action
Open

ci: extract Configure Site URL step into composite action#382
sakinaroufid wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
sakinaroufid:refactor/extract-configure-site-url-action

Conversation

@sakinaroufid
Copy link
Copy Markdown

@sakinaroufid sakinaroufid commented Apr 24, 2026

Description

Four jobs in .github/workflows/docs.yml (build_and_verify_main, build_and_verify_release, deploy_main, deploy_release) had the same 9-line inline block for resolving the GitHub Pages URL and exporting SITE_URL / SPEC_URL to $GITHUB_ENV. Any change to that logic meant editing all four places in lockstep.

Moved it into a composite action at .github/actions/configure-site-url/action.yml, matching the pattern already used by setup-build-env. Each call site is now a single uses: line.

Removes 36 lines of duplication. No behavior change, the action exports the same two env vars as before. The github-token input defaults to github.token, which is the same token the inline block used via secrets.GITHUB_TOKEN.

I didn't touch the Configure Git Credentials blocks (also duplicated, but the context differs slightly across jobs). Happy to do those in a follow-up if wanted.

Category (Required)

Please select one or more categories that apply to this change.

  • Core Protocol: Changes to the base communication layer, global context, or breaking refactors. (Requires Technical Council approval)
  • Governance/Contributing: Updates to GOVERNANCE.md, CONTRIBUTING.md, or CODEOWNERS. (Requires Governance Council approval)
  • Capability: New schemas (Discovery, Cart, etc.) or extensions. (Requires Maintainer approval)
  • Documentation: Updates to README, or documentations regarding schema or capabilities. (Requires Maintainer approval)
  • Infrastructure: CI/CD, Linters, or build scripts. (Requires DevOps Maintainer approval)
  • Maintenance: Version bumps, lockfile updates, or minor bug fixes. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool (resolver, linter, validator). (Requires Maintainer approval)
  • Community Health (.github): Updates to templates, workflows, or org-level configs. (Requires DevOps Maintainer approval)

Related Issues

None.

Checklist

  • I have followed the Contributing Guide.
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

N/A

Four jobs in docs.yml (build_and_verify_main, build_and_verify_release,
deploy_main, deploy_release) duplicated the same nine-line shell block
that queries the GitHub Pages API, falls back to a constructed URL, and
exports SITE_URL and SPEC_URL to $GITHUB_ENV. Any change to the URL
resolution logic required editing four places.

Factor the block into a new composite action at
.github/actions/configure-site-url, following the existing
setup-build-env pattern. The action accepts the GitHub token as an
input (defaulting to github.token) and writes the same two environment
variables, so downstream steps are unchanged.

Net change: 36 LOC of duplication removed, replaced with a single
25-line action plus four one-line 'uses' invocations. No runtime
behavior change.
@ptiper ptiper added the devops label Apr 24, 2026
@ptiper ptiper requested review from damaz91 and wry-ry April 24, 2026 19:24
@sakinaroufid
Copy link
Copy Markdown
Author

sakinaroufid commented Apr 24, 2026

Thanks @ptiper - I just pushed it to review

@sakinaroufid sakinaroufid marked this pull request as ready for review April 24, 2026 19:29
@sakinaroufid sakinaroufid requested review from a team as code owners April 24, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants