forked from Azure/bicep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to fix dotnet lockfiles (Azure#8954)
- Loading branch information
1 parent
980a0af
commit ac076f4
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
usage="Usage: ./scripts/fix_dotnet_lockfiles.sh <pr_id>" | ||
prId=${1:?"Missing PR id. ${usage}"} | ||
|
||
gh pr checkout $prId | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "Found unexpected changes in git working directory, aborting." | ||
exit 1 | ||
fi | ||
|
||
dotnet restore --force-evaluate | ||
git commit -a -m "Fix dotnet lockfiles" | ||
git push | ||
|
||
branchName=$(git rev-parse --abbrev-ref HEAD) | ||
git checkout main | ||
git branch -D $branchName |