Skip to content

feat: Onboards the CLA Assistant as a reusable GitHub Action #670

Merged
borislavr merged 28 commits intomainfrom
669-feat-cla-action-onboard-to-qubersip-actions
Mar 26, 2026
Merged

feat: Onboards the CLA Assistant as a reusable GitHub Action #670
borislavr merged 28 commits intomainfrom
669-feat-cla-action-onboard-to-qubersip-actions

Conversation

@nookyo
Copy link
Copy Markdown
Collaborator

@nookyo nookyo commented Mar 24, 2026

Pull Request

Summary

Onboards the CLA Assistant as a reusable GitHub Action within the qubership-workflow-hub monorepo. The action automates CLA signature collection on pull requests, storing signed contributor data in a remote JSON file and blocking merges until all contributors have signed.

Issue

Closes #669

Breaking Change?

  • Yes
  • No

Scope / Project

actions/cla-assistant

Implementation Notes

  • Ported and adapted the upstream cla-assistant/github-action to fit the qubership-workflow-hub structure.
  • Migrated the codebase to ES modules ("type": "module") and updated all imports to use .js extensions for Node ESM compatibility.
  • Bundled the action via @vercel/ncc — output lives in dist/index.js and is committed so the action can be referenced directly from a workflow without a separate install step.
  • Fixed a bug where a 404 HTTP status returned by Octokit (a number) was compared against the string "404", causing the action to always throw instead of creating the CLA file on first run. Now handles both 404 (number) and '404' (string) for robustness.
  • Supports configurable inputs: path-to-signatures, path-to-document, branch, allowlist, remote-repository-name, use-dco-flag, lock-pullrequest-aftermerge, suggest-recheck.
  • Requires GITHUB_TOKEN and optionally PERSONAL_ACCESS_TOKEN (needed when the signatures file lives in a separate repository).

Tests / Evidence

  • Built successfully via npm run build (tsc + ncc).
  • Manually tested end-to-end on a real pull request: action correctly detected missing signatures, posted the CLA comment, created the cla.json file on first run, and passed after signing.

Additional Notes

  • node_modules are not committed; dist/index.js is the only required build artifact at runtime.
  • Reviewer should ensure PERSONAL_ACCESS_TOKEN has repo scope on the remote-repository-name repository.
  • Follow-up: add unit tests for setupClaCheck, checkAllowList, and persistence modules.

nookyo added 8 commits March 24, 2026 15:41
- Implemented CLA signature storage and management through a new GitHub Action.
- Added functionality to add empty commits for CLA signatures.
- Created a checkAllowList function to filter committers based on an allowlist.
- Developed a GraphQL query to fetch committers from pull requests.
- Defined interfaces for committers and their details.
- Set up main execution flow for the action, including locking pull requests after merges.
- Integrated persistence methods for managing CLA signatures in a remote repository.
- Added pull request comment handling to manage CLA signing notifications.
- Implemented a mechanism to rerun workflows if the last check failed.
- Created shared utility functions for input handling and comment generation.
- Configured TypeScript for the project with strict type checking.
- Changed package.json to use "type": "module" and updated dependencies to their latest versions.
- Updated import statements across the codebase to use .js extensions for ES module compatibility.
- Refactored functions to utilize octokit.rest methods instead of deprecated octokit methods.
- Improved regex handling in checkAllowList function and ensured proper type handling.
- Enhanced TypeScript configuration for better module resolution and compatibility.
@nookyo nookyo requested a review from borislavr as a code owner March 24, 2026 12:53
@nookyo nookyo linked an issue Mar 24, 2026 that may be closed by this pull request
@github-actions github-actions bot added bug Something isn't working enhancement New feature or request refactor labels Mar 24, 2026
borislavr
borislavr previously approved these changes Mar 26, 2026
- Replace non-null assertions (!) with optional chaining (?.)
- Use `import type` for type-only imports
- Replace `==` with `===` to avoid unsafe type coercion
- Convert `let` to `const` for variables that are never reassigned
- Replace `var` with `let` in for-loop
- Convert function expressions to arrow functions
- Remove explicit `any` types: add IClaFileContent interface,
  type function parameters, remove unnecessary Promise<any> return types
- Remove unused `core` import in signatureComment.ts
- Use anonymous catch block instead of unused catch variable
@nookyo nookyo removed the bug Something isn't working label Mar 26, 2026
- Use import type for type-only imports in pullRequestComment,
  pullRequestCommentContent, signatureComment, setupClaCheck
- Replace non-null assertions (!) with optional chaining (?.)
- Replace == with === to avoid unsafe type coercion
- Replace committerMap && committerMap.x with committerMap?.x
- Replace .map() with .forEach() for side-effect-only callbacks
- Replace void with undefined in union return type
- Add explicit type annotation for implicitly-typed let variable
@github-actions github-actions bot added the bug Something isn't working label Mar 26, 2026
borislavr
borislavr previously approved these changes Mar 26, 2026
@nookyo nookyo removed bug Something isn't working labels Mar 26, 2026
@nookyo nookyo moved this to In Progress in qubership-DevOps Mar 26, 2026
@borislavr borislavr merged commit d7a346f into main Mar 26, 2026
22 of 27 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in qubership-DevOps Mar 26, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2026
@nookyo nookyo changed the title fix: handle both number and string status for 404 error in CLA file retrieval feat: Onboards the CLA Assistant as a reusable GitHub Action Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request refactor

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feat]: CLA-action onboard to qubersip actions

2 participants