Guest User

Untitled

a guest
Dec 3rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // Define custom options
  2. var options = {
  3. // Dry run is a special option that allows us to perform
  4. // a test run without actually copying the labels.
  5. dryRun: true
  6. };
  7.  
  8. // Instantiate with custom options
  9. var copyGitHubLabels = require('copy-github-labels')(options);
  10.  
  11. // Use basic auth
  12. copyGitHubLabels.authenticate({
  13. type: "basic",
  14. username: "[USERNAME]",
  15. password: "[PASSWORD]"
  16. });
  17.  
  18. // Define source and destination
  19. var source = '[SOURCE_REPO]';
  20. var destination = '[DESTINATION_REPO]';
  21.  
  22. // Copy labels from one repository to another
  23. // The callback is called for every label but no actual
  24. // copy operation is performed, so the destination repository is not updated.
  25. copyGitHubLabels.copy(source, destination, function (err, label) {
  26.  
  27. // Log errors
  28. if (err) {
  29. return console.log('Could not copy label: ' + JSON.stringify(err));
  30. }
  31.  
  32. // Log copies
  33. console.log('Label copied successfully: ' + JSON.stringify(label))
  34. });
Add Comment
Please, Sign In to add comment