Skip to content

Commit

Permalink
Add script to fix dotnet lockfiles (Azure#8954)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-c-martin authored Nov 8, 2022
1 parent 980a0af commit ac076f4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/fix_dotnet_lockfiles.sh
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

0 comments on commit ac076f4

Please sign in to comment.