Skip to content

Bump the opentelemetry group across 1 directory with 3 updates #919

Bump the opentelemetry group across 1 directory with 3 updates

Bump the opentelemetry group across 1 directory with 3 updates #919

name: "Automatically update dotnet lockfiles in dependabot PRs"
on:
workflow_dispatch:
pull_request_target:
env:
SOLUTION_PATH: "src/backend"
SOLUTION_NAME: "Backend.sln"
DOTNET_VERSION: "9.0.x"
jobs:
update-lockfiles:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Checkout ${{ github.head_ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Setup git user
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update lockfiles
working-directory: ${{ env.SOLUTION_PATH }}
run: |
dotnet restore ${{ env.SOLUTION_NAME }}
git status
if output=$(git status --porcelain) && [ -z "$output" ]; then
# Working directory clean - do nothing
echo Working directory clean
exit 0
else
# Uncommitted changes
echo Add and commit changes
git commit -a -m "Update lockfiles"
git push
fi