Update NuGet packages #2
This file contains hidden or 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
name: Update NuGet packages | |
on: | |
schedule: | |
- cron: '0 3 * * 1' # Chaque lundi à 03:00 UTC | |
workflow_dispatch: # Déclenchement manuel possible | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Install dotnet-outdated tool | |
run: dotnet tool install --global dotnet-outdated-tool | |
- name: Configure Git identity | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Create update branch | |
run: | | |
$branchName = "update-packages-$(Get-Date -Format 'yyyyMMdd')" | |
git checkout -b $branchName | |
echo "BRANCH_NAME=$branchName" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Run dotnet-outdated and upgrade packages | |
run: dotnet outdated -u --include-auto-references --fail-on-updates NeedABreak.Updater.sln | |
- name: Commit changes | |
run: | | |
git add . | |
git commit -m "Update NuGet packages" | |
git push origin $env:BRANCH_NAME | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: "Update NuGet packages" | |
body: "Automated NuGet package update via dotnet-outdated." | |
head: ${{ env.BRANCH_NAME }} | |
base: root | |
branch: ${{ env.BRANCH_NAME }} |