Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define custom options
- var options = {
- // Dry run is a special option that allows us to perform
- // a test run without actually copying the labels.
- dryRun: true
- };
- // Instantiate with custom options
- var copyGitHubLabels = require('copy-github-labels')(options);
- // Use basic auth
- copyGitHubLabels.authenticate({
- type: "basic",
- username: "[USERNAME]",
- password: "[PASSWORD]"
- });
- // Define source and destination
- var source = '[SOURCE_REPO]';
- var destination = '[DESTINATION_REPO]';
- // Copy labels from one repository to another
- // The callback is called for every label but no actual
- // copy operation is performed, so the destination repository is not updated.
- copyGitHubLabels.copy(source, destination, function (err, label) {
- // Log errors
- if (err) {
- return console.log('Could not copy label: ' + JSON.stringify(err));
- }
- // Log copies
- console.log('Label copied successfully: ' + JSON.stringify(label))
- });
Add Comment
Please, Sign In to add comment