Update packages #22
This file contains 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 packages | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 2 * * 0" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update_packages: | |
name: Update packages | |
runs-on: windows-latest | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/[email protected] | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.generate_token.outputs.token }} | |
- name: Set solution name | |
run: | | |
echo "solution=$(([io.fileinfo]$(Get-ChildItem -Path .\* -Include *.sln)).name)" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- name: Setup Nuget | |
uses: nuget/setup-nuget@v1 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- name: Create new branch | |
run: git branch features/update_dependencies_${{ github.run_number }} | |
- name: Switch branch | |
run: git checkout features/update_dependencies_${{ github.run_number }} | |
- name: NuGet restore | |
run: nuget restore | |
- name: Update NuGet packages | |
run: nuget update "${{ env.solution }}" -FileConflictAction Ignore | |
- name: Setup GIT config | |
run: | | |
git config user.name "dotNETFrameworkUpdater" | |
git config user.email "<>" | |
git config --global --add --bool push.autoSetupRemote true | |
- name: Commit and Push | |
run: | | |
git add . | |
git commit -a -m "Packages update (CI)" | |
git push | |
create_pull_request: | |
name: Create pull request | |
runs-on: ubuntu-latest | |
needs: update_packages | |
steps: | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/[email protected] | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.generate_token.outputs.token }} | |
ref: features/update_dependencies_${{ github.run_number }} | |
- name: Create pull request | |
uses: devops-infra/[email protected] | |
with: | |
github_token: ${{ steps.generate_token.outputs.token }} | |
source_branch: features/update_dependencies_${{ github.run_number }} | |
target_branch: main | |
title: Update NuGet packages | |
assignee: guibranco | |
reviewer: guibranco | |
label: dependencies,.NET,infra,NuGet,packages | |
template: .github/PULL_REQUEST_TEMPLATE/FEATURE.md | |
get_diff: true |