Skip to content

.NET Package Update #21

.NET Package Update

.NET Package Update #21

name: .NET Package Update
on:
schedule:
- cron: '30 7 * * 1'
workflow_dispatch: # allow running by manual trigger
jobs:
check-for-updates:
name: Check for Updates
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # full checkout
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- name: Install dotnet-outdated
run: dotnet tool install --global dotnet-outdated-tool
- name: Run dotnet-outdated
run: dotnet outdated --upgrade -o upgrade.md -of Markdown
- name: Output to summary
run: |
if test -f upgrade.md; then
cat upgrade.md >> $GITHUB_STEP_SUMMARY
else
echo "# All packages are up to date" >> $GITHUB_STEP_SUMMARY
fi
- name: Add updated files to Git
run: |
git diff -s --exit-code && exit 0
git config --global user.email "bot@excos.dev"
git config --global user.name "Excos Bot"
git checkout -b "package-update/dotnet/run$GITHUB_RUN_NUMBER"
git add -u
git commit -m ".NET Package update"
git push -u origin "package-update/dotnet/run$GITHUB_RUN_NUMBER"
gh pr create -B main -H "package-update/dotnet/run$GITHUB_RUN_NUMBER" --title "[DEPS] .NET Package Update ($(date +%D))" --body "$(cat upgrade.md)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}