@@ -2,9 +2,9 @@ name: "CodeQL"
22
33on :
44 push :
5- branches : [master]
5+ branches : [ master ]
66 pull_request :
7- branches : [master]
7+ branches : [ master ]
88 paths-ignore :
99 - " **/*.mtf"
1010 - " **/*.blk"
@@ -15,14 +15,58 @@ jobs:
1515 analyze :
1616 name : Analyze
1717 strategy :
18- matrix :
19- os : [ubuntu-latest]
20- java-distribution : [temurin]
21- java-version : [17]
2218 fail-fast : false
23- runs-on : [ubuntu-latest]
19+ runs-on : [ ubuntu-latest ]
20+
21+ outputs :
22+ mmRepo : ${{ steps.find_mm.outputs.mmRepo }}
23+ mmBranch : ${{ steps.find_mm.outputs.mmBranch }}
2424
2525 steps :
26+ - name : Find the Right MegaMek Branch
27+ id : find_mm
28+ shell : bash {0}
29+ run : |
30+ git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }}
31+ if [ "$?" == "0" ]
32+ then
33+ echo "mmRepo=${{ github.event.pull_request.head.repo.owner.login }}/megamek" >> $GITHUB_OUTPUT
34+ echo "mmBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
35+ else
36+ echo "mmRepo=MegaMek/megamek" >> $GITHUB_OUTPUT
37+ echo "mmBranch=master" >> $GITHUB_OUTPUT
38+ fi
39+ exit 0
40+
41+ - name : Checkout MegaMek
42+ uses : actions/checkout@v4
43+ with :
44+ repository : ${{ steps.find_mm.outputs.mmRepo }}
45+ ref : ${{ steps.find_mm.outputs.mmBranch }}
46+ path : megamek
47+
48+ - name : Find the Right MegaMekLab Branch
49+ id : find_mml
50+ shell : bash {0}
51+ run : |
52+ git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megameklab.git ${{ github.event.pull_request.head.ref }}
53+ if [ "$?" == "0" ]
54+ then
55+ echo "mmlRepo=${{ github.event.pull_request.head.repo.owner.login }}/megameklab" >> $GITHUB_OUTPUT
56+ echo "mmlBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
57+ else
58+ echo "mmlRepo=MegaMek/megameklab" >> $GITHUB_OUTPUT
59+ echo "mmlBranch=master" >> $GITHUB_OUTPUT
60+ fi
61+ exit 0
62+
63+ - name : Checkout MegaMekLab
64+ uses : actions/checkout@v4
65+ with :
66+ repository : ${{ steps.find_mml.outputs.mmlRepo }}
67+ ref : ${{ steps.find_mml.outputs.mmlBranch }}
68+ path : megameklab
69+
2670 - name : " Check out MekHQ"
2771 uses : actions/checkout@v4
2872
3276 languages : java-kotlin
3377 build-mode : none
3478 queries : security-and-quality
79+ config : |
80+ paths:
81+ - mekhq
3582
3683 - name : Perform CodeQL Analysis
3784 uses : github/codeql-action/analyze@v3
0 commit comments