Skip to content

Commit 86f1954

Browse files
authored
Merge pull request #144 from igorbolic/skip-jobs-on-forks
Skip release & code analysis jobs on fork repositories
2 parents 57f6319 + 5363c83 commit 86f1954

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
- '*'
1010
pull_request:
1111

12-
env:
13-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
14-
1512
jobs:
1613
build:
1714
strategy:
@@ -25,6 +22,7 @@ jobs:
2522
- java: 17
2623
sonar: false
2724
name: Build
25+
if: github.repository == 'sixhours-team/memcached-spring-boot'
2826
runs-on: ubuntu-latest
2927
steps:
3028
- uses: actions/checkout@v3
@@ -49,7 +47,9 @@ jobs:
4947
echo "Build Branch => Branch [$GITHUB_REF_NAME]"
5048
./gradlew build
5149
- name: Run code analysis
52-
if: ${{ matrix.sonar }}
50+
if: ${{ matrix.sonar && github.event_name != 'pull_request'}}
5351
run: |
5452
echo "Run SonarQube Analysis => Branch [$GITHUB_REF_NAME]"
55-
./gradlew sonarqube -Dsonar.verbose=true
53+
./gradlew sonarqube -Dsonar.verbose=true --stacktrace
54+
env:
55+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/release-snapshot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
snapshot:
1010
name: Release Snapshot
11+
if: github.repository == 'sixhours-team/memcached-spring-boot'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/checkout@v3

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
release:
1010
name: Release
11+
if: github.repository == 'sixhours-team/memcached-spring-boot'
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/checkout@v3

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def gitVersion = { ->
3434
return !version.isEmpty() ? version - 'v' : projectVersion
3535
}
3636

37-
def resolvedVersion = project.findProperty('release') ? gitVersion() : '2.4.3-SNAPSHOT'
37+
def resolvedVersion = project.findProperty('release') ? gitVersion() : '2.4.4-SNAPSHOT'
3838

3939
sonarqube {
4040
properties {

0 commit comments

Comments
 (0)