Skip to content

chore: Bump Microsoft.NET.Test.Sdk from 17.8.0 to 18.0.1 #25

chore: Bump Microsoft.NET.Test.Sdk from 17.8.0 to 18.0.1

chore: Bump Microsoft.NET.Test.Sdk from 17.8.0 to 18.0.1 #25

Workflow file for this run

name: Pull Request Validation
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ master, develop ]
jobs:
validate:
name: Build and Test PR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --no-restore --configuration Release --verbosity minimal
- name: Run tests
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Comment PR
uses: actions/github-script@v7
if: always()
with:
script: |
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('🤖 Build Status')
);
const status = '${{ job.status }}' === 'success' ? '✅ Success' : '❌ Failed';
const body = `🤖 Build Status: ${status}
Build and test validation completed for this pull request.
${status === '✅ Success' ? 'All checks passed! ✨' : 'Please check the workflow logs for details.'}`;
if (botComment) {
github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body
});
} else {
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}