- Notifications
You must be signed in to change notification settings - Fork 231
/
Copy pathCommitAndPushChangesToGithub.ps1
21 lines (17 loc) · 806 Bytes
/
CommitAndPushChangesToGithub.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Param(
[string]$owner,
[string]$repo,
[string]$branchName,
[string]$newVersion,
[string]$gitPat
)
Write-Host"Pushing Version bump change to Github:"-ForegroundColor Magenta;
Write-Host"Adding Changes."-ForegroundColor Blue;
git add .|Write-Host;
Write-Host"Changes added to the '$($branchName)' branch."-ForegroundColor Green;
Write-Host"Committing Changes."-ForegroundColor Blue;
git commit -m "Bumped version to '$($newVersion)'"|Write-Host;
Write-Host"Committed the changes to the '$($branchName)' branch."-ForegroundColor Green;
Write-Host"Pushing changes."-ForegroundColor Blue;
git push "https://$($gitPat)@github.com/$($owner)/$($repo).git" HEAD:$branchName|Write-Host;
Write-Host"Pushed the changes to the '$($branchName)' branch."-ForegroundColor Green;