name: dotnet-outdated

on:
  push:
    branches: 
    - "master"
    - "main"
    - "dev"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Setup .NET 6
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0.x'
        include-prerelease: true
    - name: build
      run: dotnet build
    - name: install dotnet-outdated
      run: dotnet tool install --global dotnet-outdated-tool
    - name: Run dotnet-outdated
      run: dotnet-outdated -u
    - name: Build again
      run: dotnet build
    - name: check for changes
      run: |
        if git diff --exit-code; then
          echo "has_changes=false" >> $GITHUB_ENV
        else
          echo "has_changes=true" >> $GITHUB_ENV
        fi
    - name: Create Pull Request
      if: ${{ env.has_changes == 'true' }}
      uses: peter-evans/create-pull-request@v3
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        commit-message: "Update NuGet Packages"
        title: 'Update NuGet Packages'
        body: >
          This PR updates the outdated NuGet packages.
        labels: automated pr
        branch: update-nuget-dependencies

name: dotnet-outdated

on:
  push:
    branches: 
    - "master"
    - "main"
    - "dev"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Setup .NET 6
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '6.0.x'
        include-prerelease: true
    - name: build
      run: dotnet build
    - name: install dotnet-outdated
      run: dotnet tool install --global dotnet-outdated-tool
    - name: Run dotnet-outdated
      run: dotnet-outdated -u
    - name: Build again
      run: dotnet build
    - name: check for changes
      run: |
        if git diff --exit-code; then
          echo "has_changes=false" >> $GITHUB_ENV
        else
          echo "has_changes=true" >> $GITHUB_ENV
        fi
    - name: Create Pull Request
      if: ${{ env.has_changes == 'true' }}
      uses: peter-evans/create-pull-request@v3
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        commit-message: "Update NuGet Packages"
        title: 'Update NuGet Packages'
        body: >
          This PR updates the outdated NuGet packages.
        labels: automated pr
        branch: update-nuget-dependencies
        base: ${{ github.ref }}

Update base branch for the auto-pr
Update base branch for the auto-pr
