feat(cmd): add import command
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
Description
This MR creates a new CLI command under variables which helps the user to "import" the CI/CD variables from JSON files as well as STDIN
Affected files:
- internal\commands\variable\import\import.go (new file)
- internal\commands\variable\import\import_test.go (new file)
- internal\commands\variable\variable.go
Related Issues
Resolves #7952
How has this been tested?
- I created a glab.exe by executing the main.go and ran the CLI command pointing to my personal fork and verified the existence of the variables under CI/CD section
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by ajey muthiah