Skip to content

Commit

Permalink
Update version-sweeper.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayKMehta authored Dec 1, 2024
1 parent 6cfb2b9 commit e066bc1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/version-sweeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
description: "The reason for running the workflow"
required: true
default: "Manual run"
support:
description: "The support level to target (STS, LTS, or Preview)."
required: true
default: "LTS"
permissions:
contents: read

Expand Down Expand Up @@ -46,3 +50,35 @@ jobs:
name: ${{ github.repository }}
branch: ${{ github.ref }}
sdkCompliance: true
- name: Create pull requests
if: steps.dotnet-version-sweeper.outputs.has-remaining-work == 'true'
run: |
upgradeProjects: ${{ steps.dotnet-version-sweeper.outputs.upgrade-projects }}
# Install .NET Upgrade Assistant global tool
dotnet tool install --global upgrade-assistant
# Iterate all upgrade projects
for projectDir in "${upgradeProjects[@]}"; do
echo "Project Directory: $projectDir"
# Create a new branch
git checkout -b upgrade/$projectDir
# Perform the upgrade using upgrade-assistant
upgrade-assistant upgrade "$projectDir" --non-interactive -t ${{ inputs.support }}
# Commit the changes
git add .
git commit -m ".NET Version Sweeper: Upgraded $projectDir"
# Push the branch to the repository
git push origin upgrade/$projectDir
# Create a pull request
gh pr create \
--base main \
--head upgrade/$projectDir \
--title "Upgraded $projectDir" \
--body "Proposed upgrade for $projectDir"
done

0 comments on commit e066bc1

Please sign in to comment.