Skip to content

Commit 2c05678

Browse files
committed
fork checkout first
1 parent 6bbb36b commit 2c05678

File tree

2 files changed

+13
-29
lines changed

2 files changed

+13
-29
lines changed

.github/workflows/analyze.yml

+11-21
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ jobs:
1919
if: github.event.workflow_run.head_repository.owner.login != 'dnsjava'
2020
runs-on: ubuntu-latest
2121
steps:
22-
- name: echo
23-
run: |
24-
cat << EOF
25-
${{ toJson(github) }}
26-
EOF
27-
2822
- name: Download PR number artifact
2923
id: get_pr_number
3024
uses: dawidd6/action-download-artifact@v2
@@ -35,7 +29,6 @@ jobs:
3529

3630
- name: Read Pull Request Number
3731
id: pr_number
38-
shell: bash
3932
run: |
4033
PR=$(cat pr_number.txt)
4134
echo "pr_number=${PR}" >> "$GITHUB_OUTPUT"
@@ -51,13 +44,6 @@ jobs:
5144
full_name: ${{ github.event.repository.full_name }}
5245
number: ${{ steps.pr_number.outputs.pr_number }}
5346

54-
- name: Checkout base
55-
uses: actions/checkout@v3
56-
with:
57-
repository: ${{ github.event.repository.full_name }}
58-
ref: ${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
59-
path: base
60-
6147
- name: Checkout PR
6248
uses: actions/checkout@v3
6349
with:
@@ -66,20 +52,24 @@ jobs:
6652
# for Sonar
6753
fetch-depth: 0
6854

69-
- name: Get analysis data
70-
uses: ./base/.github/actions/prepare-analysis
55+
- name: Make sure 'base' doesn't exist
56+
shell: bash
57+
run: rm -rf base
7158

72-
- name: Set up JDK
73-
uses: actions/setup-java@v3
59+
- name: Checkout base
60+
uses: actions/checkout@v3
7461
with:
75-
java-version: ${{ env.BUILD_JAVA_VERSION }}
76-
distribution: temurin
62+
repository: ${{ github.event.repository.full_name }}
63+
ref: ${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
64+
path: base
65+
66+
- name: Get analysis data
67+
uses: ./base/.github/actions/prepare-analysis
7768

7869
- name: Run SonarQube
7970
env:
8071
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8172
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
82-
shell: bash
8373
run: |
8474
cp -f base/pom.xml .
8575
mvn -B \

.github/workflows/build.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ jobs:
8080
runs-on: ubuntu-latest
8181
needs: build
8282
steps:
83-
- name: echo
84-
run: |
85-
cat << EOF
86-
${{ toJson(github) }}
87-
EOF
88-
8983
- name: Checkout
9084
uses: actions/checkout@v3
9185

@@ -118,11 +112,11 @@ jobs:
118112
target/jacoco.exec
119113
120114
- name: Save PR number to file
121-
if: github.event_name == 'pull_request'
115+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'dnsjava'
122116
run: echo ${{ github.event.number }} > pr_number.txt
123117

124118
- name: Archive PR number
125-
if: github.event_name == 'pull_request'
119+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != 'dnsjava'
126120
uses: actions/upload-artifact@v3
127121
with:
128122
name: pr_number

0 commit comments

Comments
 (0)