How to add commits through CICD pipeline

I like to add commit message to my master brach when i create new release.
With that commit message will trigger nightly deployment process.

When i try the below commad


stage: CodeCommit





- |

  curl --request POST --header 'PRIVATE-TOKEN: ${CI_JOB_TOKEN}' --data '{"branch": "master", "commit_message": "RedyForDeploy"}' \


Powershell Output:

$ curl --request POST --header ‘PRIVATE-TOKEN: ${CI_JOB_TOKEN}’ --data ‘{“branch”: “master”, “commit_message”: “create a new file”}’ \ # collapsed multi-line command

Invoke-WebRequest : A positional parameter cannot be found that accepts argument ‘POST’.

At C:\Windows\TEMP\build_script078740762\script.ps1:245 char:1

  • curl --request POST --header ‘PRIVATE-TOKEN: ${CI_JOB_TOKEN}’ --data …
    )+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • CategoryInfo : InvalidArgument: (:slight_smile: [Invoke-WebRequest], ParameterBindingException

) + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

"content" is mandatory for Repository files API | GitLab

You can use Commits API | GitLab if you want to make an empty commit

$headers = @{
  "PRIVATE-TOKEN" = "*****************"
$body = @{
  "branch" = "main"
  "commit_message" = "this is a commit"
  "actions" = ""
Invoke-RestMethod -Verbose -Header $headers -ContentType 'application/json' -Body ($body|ConvertTo-Json) -Method Post -Uri "****/repository/commits"