["git checkout stable & git pull","Checkout and update the release branch"],
["grunt test","Run tests"],
["grunt chg-release:{{ type }}","Update the changelog with the new release"],
["grunt version:{{ type }}","Bump package versions"],
["grunt","Build the release"],
["git add dist/video-js --force","Add the (otherwise ignored) release files"],
["grunt vjsdocs","Rebuild the docs"],
["grunt cdn-links","Update the cdn urls in the docs"],
["grunt tagrelease","Tag the release"],
["git push origin stable","Push changes to the remote"],
["git push --tags","Push tags to the remote"],
["npm publish","Publish to npm"],
["git checkout master && git merge stable","Checkout the development branch (master) and merge changes"],
["grunt clean:dist","Remove built dist files to re-ignore them"],
["git add -u","Add the changes for the removed dist files"],
["git commit -m 'Removed dist files'","Commit the removed dist files"],
["git push origin master","Push development branch changes"]
]
},
"branch":{
"private":true,
"start":{
"steps":[
{"prompt":"Name the branch","id":"name"},
["git checkout -b {{name}} {{baseBranch}}","Create the branch"],
["git push -u origin {{name}}","Push the branch to your remote copy of the project"]
]
},
"submit":{
"desc":"Submit a pull request for when the change is finished",
"steps":[
{"exec":"git diff --exit-code","desc":"Test for unadded changes {{ args.[0] }}","fail":"Make sure all changes have been added and committed, or stashed, before switching branches"},
{"exec":"git diff --cached --exit-code","desc":"Test for uncommitted changes","fail":"Make sure all changes have been added and committed, or stashed, before switching branches"},
{"include":"test"},
{"exec":"git rev-parse --abbrev-ref HEAD","desc":"Get the current branch","id":"branch"},
{"confirm":"Are you sure {{branch}} is the branch you want to submit?"},
{"prompt":"Which github user or org are you submitting from?","id":"user"},
{"open":"{{project.urls.repo_ui}}/compare/videojs:{{baseBranch}}...{{user}}:{{branch}}","desc":"Open the github pull request page"}
]
},
"delete":{
"desc":"Delete the current branch",
"steps":[
{"exec":"git rev-parse --abbrev-ref HEAD","desc":"Get the current branch name","id":"name"},
{"confirm":"Are you sure '{{name}}' is the branch you want to delete?"},
{"exec":"git branch -D {{name}}","desc":"Delete the local copy of the branch"},
{"exec":"git push origin :{{name}}","desc":"Delete the remote copy of the branch"}
]
}
},
"pull_request":{
"private":true,
"start":{
"steps":[
{"prompt":"What is the the pull request number?","id":"prNum"},
{"get":"{{project.urls.repo_api}}/pulls/{{prNum}}","desc":"Get the PR information","id":"pr"},
["git checkout -b review-{{pr.user.login}}-{{pr.head.ref}} {{pr.base.ref}}","Checkout a new branch for reviewing changes"],
["git pull {{pr.head.repo.ssh_url}} {{pr.head.ref}}","Pull in the changes"],
["grunt test","Build and run tests"]
]
},
"modify":{
"desc":"Submit a modification to an existing pull request",
"steps":[
{"exec":"git diff --exit-code","desc":"Test for unadded changes","fail":"Make sure all changes have been added and committed, or stashed, before switching branches"},
{"exec":"git diff --cached --exit-code","desc":"Test for uncommitted changes","fail":"Make sure all changes have been added and committed, or stashed, before switching branches"},
{"include":"test"},
{"exec":"git rev-parse --abbrev-ref HEAD","desc":"Get the current branch","id":"branch"},
{"confirm":"Are you sure {{branch}} is the branch you want to submit?"},
{"prompt":"Which github user or org are you submitting from?","id":"user"},
{"prompt":"What is the the pull request number?","id":"prNum"},
{"get":"{{project.urls.repo_api}}/pulls/{{prNum}}","desc":"Get the PR information","id":"pr"},
{"exec":"git push -u origin {{branch}}","desc":"Push the changes to the remote repo"},
{"open":"https://github.com/{{user}}/video.js/compare/{{pr.head.label}}...{{user}}:{{branch}}","desc":"Open the github pull request page"}
]
},
"accept":[
{"prompt":"What is the the pull request number?","id":"prNum"},
{"get":"{{project.urls.repo_api}}/pulls/{{prNum}}","desc":"Get the PR information","id":"pr"},
{"get":"{{project.urls.repo_api}}/pulls/{{prNum}}/commits","desc":"Get the PR commits to access author info","id":"prCommits"},
["git checkout -b {{pr.user.login}}-{{pr.head.ref}} {{pr.base.ref}}","Create a new branch for merging the changes"],
["git fetch {{pr.head.repo.ssh_url}} {{pr.head.ref}}","Fetch the changes"],
["git merge --no-commit --squash FETCH_HEAD","Merge the changes in without committing so they can be squashed"],
["grunt test","Run tests to make sure they still pass"],
{"prompt":"Describe this change in one line","id":"line"},
["grunt chg-add:'{{line}} ([view](https\\://github.com/videojs/video.js/pull/{{prNum}}))'","Add a line to the changelog"],
["git add CHANGELOG.md","Add the changlelog change to be committed"],
["git commit -a --author='{{prCommits.[0].commit.author.name}} <{{prCommits.[0].commit.author.email}}>' -m '{{line}}. closes #{{prNum}}'","Commit the changes"],
{"confirm":"Does everything look ok?"},
["git checkout {{pr.base.ref}}","Check out the base branch"],
["git merge {{pr.user.login}}-{{pr.head.ref}}","Merge the changes"],
["git push origin {{pr.base.ref}}","Push the changes to your remote copy of the project"],
["git push upstream {{pr.base.ref}}","Push the changes to the main project"],
["git branch -D {{pr.user.login}}-{{pr.head.ref}}","Delete the local branch used for merging"]