Skip to content

Update NuGet packages #8

Update NuGet packages

Update NuGet packages #8

name: Update NuGet packages
on:
workflow_dispatch:
schedule:
# Every Sunday at 8am
- cron: '0 8 * * Sun'
permissions:
issues: write
pull-requests: write
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
setup:
runs-on: ubuntu-latest
name: Setup
steps:
- uses: actions/checkout@v4
- name: Run dotnet outdated
run: |
dotnet tool install --global dotnet-outdated-tool
cd ./src/OrchardCore.Modules/OrchardCore.Markdown
OUTPUT=$(dotnet-outdated --version-lock major --upgrade)
if [[ $OUTPUT =~ "No outdated dependencies were detected" ]]; then
echo "::set-output name=updated::false"
else
echo "::set-output name=updated::true"
fi
shell: bash
- name: Create pull request
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
git branch -D outdated || true
git branch -c outdated
git checkout -b outdated
git commit -am "Update NuGet packages"
git push origin HEAD --force
gh pr create -B main -H outdated --title 'Update NuGet packages' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}