Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
na1307 authored Dec 26, 2024
2 parents 6042c77 + 7da7ca5 commit 97ba1e9
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/SonarCloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,47 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
branches:
- main

permissions:
contents: read
pull-requests: read

jobs:
build:
sonarcloud:
name: SonarCloud
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if PR
shell: bash
run: echo "PR=${{ github.event_name == 'pull_request_target' }}" >> $GITHUB_ENV
- name: Check Modified Files
id: check-files
if: env.PR == 'true'
uses: dorny/paths-filter@v3
with:
filters: |
github:
- '.github/**'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Exit if unsafe PR
if: env.PR == 'true' && steps.check-files.outputs.github == 'true'
run: |
echo "Unsafe PR detected: Modifications to .github/ files are not allowed."
exit 1
- name: Checkout PR head if safe
if: env.PR == 'true' && steps.check-files.outputs.github == 'false'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
Expand Down

0 comments on commit 97ba1e9

Please sign in to comment.