-
-
Notifications
You must be signed in to change notification settings - Fork 48
Potential fix for dependabot #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
ae02d17
36e48f5
8936f96
0d1d4f7
8243886
6e5a5f2
1425aaf
5a26fdd
25f29ea
27a992d
2c51cbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,36 @@ | ||||||||||||||||||||||||||||||
| name: Check for dependabot update | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| on: [pull_request] | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||
| restore: | ||||||||||||||||||||||||||||||
| name: Fix NuGet Lock Files | ||||||||||||||||||||||||||||||
| if: contains(github.head_ref, 'dependabot') && github.event_name == 'pull_request' | ||||||||||||||||||||||||||||||
| runs-on: windows-latest | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - uses: actions/checkout@v5 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| ref: ${{ github.head_ref }} | ||||||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # - uses: actions/setup-dotnet@v3 | ||||||||||||||||||||||||||||||
| # with: | ||||||||||||||||||||||||||||||
| # dotnet-version: | | ||||||||||||||||||||||||||||||
| # 4.7.2 | ||||||||||||||||||||||||||||||
| # 4.8 | ||||||||||||||||||||||||||||||
| # 6.0 | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - run: dotnet restore --force-evaluate | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify that dotnet restore succeeds before committing. The workflow commits and pushes lock file changes without explicitly verifying that - run: dotnet restore --force-evaluate
+ id: restore
+ - if: failure()
+ run: echo "dotnet restore failed" && exit 1🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| - id: diff | ||||||||||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||
| git add -N . | ||||||||||||||||||||||||||||||
| git diff --name-only --exit-code | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| - if: steps.diff.outcome == 'failure' | ||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||||||||||||||||||||||||||
| git config user.name "github-actions[bot]" | ||||||||||||||||||||||||||||||
| git add . | ||||||||||||||||||||||||||||||
| git commit -m "chore(deps): update NuGet lock file" | ||||||||||||||||||||||||||||||
| git push | ||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error handling for git push and verify push succeeds. The For clarity and safety, consider:
- if: steps.diff.outcome == 'failure'
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git commit -m "chore(deps): update NuGet lock file"
- git push
+ git push origin ${{ github.head_ref }} || (echo "Push failed" && exit 1)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify intent of commented-out setup-dotnet step.
The commented code suggests uncertainty about which .NET versions to target. Either:
Leaving it commented may confuse future maintainers about whether this is incomplete work.
🤖 Prompt for AI Agents