Description
- Node.js version:
24.12.0
- Gitbeaker version:
43.8.0
- Gitbeaker release (cli, rest, core, requester-utils):
@gitbeaker/core
- OS & version: N/A
A GitLab regression was introduced last year which prevented empty commits from being created via the GitLab API. This was recently fixed in this GitLab PR. As a resulf of that PR's changes, a new optional argument allow_empty and allowEmpty has been introduced. This has not been added to the types as of yet.
Steps to reproduce
Example code:
import { Gitlab } from '@gitbeaker/rest';
const api = new Gitlab({
host: 'https://gitlab.com',
token: 'your-token',
});
await api.Commits.create(
projectID,
branchName,
'Commit message',
[], // empty actions, i.e., empty commit
{
startProject: startProject,
startSha: startSHA,
allowEmpty: true, // TypeScript error: Property 'allowEmpty' does not exist
},
);
Expected behaviour
The allowEmpty option should be recognized as a valid optional parameter in the Commits.create() method's type definition.
Actual behaviour
A typescript error:
Object literal may only specify known properties, and 'allowEmpty' does not exist in type 'CreateCommitOptions & Sudo & ShowExpanded<false>'.
Possible fixes
Introduce this type into CreateCommitOptions and possibly other places if necessary.
Checklist
Description
24.12.043.8.0@gitbeaker/coreA GitLab regression was introduced last year which prevented empty commits from being created via the GitLab API. This was recently fixed in this GitLab PR. As a resulf of that PR's changes, a new optional argument
allow_emptyandallowEmptyhas been introduced. This has not been added to the types as of yet.Steps to reproduce
Example code:
Expected behaviour
The
allowEmptyoption should be recognized as a valid optional parameter in theCommits.create()method's type definition.Actual behaviour
A typescript error:
Possible fixes
Introduce this type into
CreateCommitOptionsand possibly other places if necessary.Checklist