GitLab File Create VERSION 1


Creates a new file in an existing GitLab project and branch using a user's private token (obtained in GitLab under the inteded user's 'Settings' => 'Account') and the location, name, and contents of the file that should be added. The project the file should be added to is found through providing the projects path (which is the project name provided in the URL - not necessarily the same as the readable name) and the project group (if it is in something other than the default group). The file and the location it should be placed at is built based upon the branch, folder, file name, and file contents parameters. If the branch provided doesn't currently exist, it will be created upon successful addition of the file. An empty result set will be returned on successful file creation.


Parameters

NameDescription
Project GroupPath of the group where the project and branch are located (defaults to the GitLab default group if not provided).
Project PathPath of the project where the branch is located.
BranchBranch that the file should be added to.
FolderPath to a folder to create the file in (if left blank, file will be created in the root folder).
File NameName of the file (including the desired extension).
File ContentsContents of the file.
Commit MessageCommit message that the file will be added with.

Sample Configuration

NameDescription
Project Groupsuper-secret-group
Project Pathtest-project
Branchmaster
Folderlib
File NameREADME.md
File ContentsA README file inside the lib directory for a test project
Commit MessageAdding a README file

Results

This handler does not return any results.


Changelog

GitLab File Create V1 (2017-10-02)

* Initial version. See README for details.