Skip to content

Commit 2f0e551

Browse files
authored
Merge pull request #534 from AuthMe/megalint-fix
Fix megalinter config, pin GH Action versions, misc zizmor fixes
1 parent 0a7a3a7 commit 2f0e551

3 files changed

Lines changed: 23 additions & 12 deletions

File tree

.github/workflows/maven_jdk8.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ jobs:
1212
coveralls_repo_token: ${{ secrets.COVERALLS_REPO_TOKEN }}
1313

1414
steps:
15-
- uses: actions/checkout@v7
15+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
16+
with:
17+
persist-credentials: false
1618

1719
- name: Set up JDK 8
18-
uses: actions/setup-java@v5
20+
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
1921
with:
2022
java-version: '8'
2123
distribution: 'adopt'
@@ -24,7 +26,7 @@ jobs:
2426
run: mvn -B --file pom.xml package jacoco:report
2527

2628
- name: Coveralls
27-
uses: coverallsapp/github-action@v2
29+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
2830
if: github.event_name != 'pull_request'
2931
with:
3032
base-path: src/main/java

.github/workflows/maven_jdk_lts.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ jobs:
1515
name: Java ${{ matrix.java }} build
1616

1717
steps:
18-
- uses: actions/checkout@v7
18+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
19+
with:
20+
persist-credentials: false
21+
1922
- name: Set up Java
20-
uses: actions/setup-java@v5
23+
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a # v5.5.0
2124
with:
2225
java-version: ${{ matrix.java }}
2326
distribution: 'adopt'

.github/workflows/mega-linter.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ env:
3535
# or posted in a PR (pull_request)
3636
APPLY_FIXES_MODE: commit
3737

38+
ACTION_ZIZMOR_UNSECURED_ENV_VARIABLES: 'GITHUB_TOKEN'
39+
3840
concurrency:
3941
group: ${{ github.ref }}-${{ github.workflow }}
4042
cancel-in-progress: true
@@ -47,20 +49,21 @@ jobs:
4749
steps:
4850
# Git Checkout
4951
- name: Checkout Code
50-
uses: actions/checkout@v7
52+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5153
with:
5254
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
5355

5456
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
5557
# improve performance
5658
fetch-depth: 0
59+
persist-credentials: false
5760

5861
# MegaLinter
5962
- name: MegaLinter
6063

6164
# You can override MegaLinter flavor used to have faster performances
6265
# More info at https://megalinter.io/latest/flavors/
63-
uses: oxsecurity/megalinter/flavors/java@v9
66+
uses: oxsecurity/megalinter/flavors/java@ef3e84b8b836d76db562d0f3ed7da61e8fd538bc # v9.6.0
6467

6568
id: ml
6669

@@ -98,7 +101,7 @@ jobs:
98101

99102
# Upload MegaLinter artifacts
100103
- name: Archive production artifacts
101-
uses: actions/upload-artifact@v6
104+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
102105
if: success() || failure()
103106
with:
104107
name: MegaLinter reports
@@ -110,7 +113,7 @@ jobs:
110113
# Create pull request if applicable
111114
# (for now works only on PR from same repository, not from forks)
112115
- name: Create Pull Request with applied fixes
113-
uses: peter-evans/create-pull-request@v8
116+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
114117
id: cpr
115118
if: >-
116119
steps.ml.outputs.has_updated_sources == 1 &&
@@ -144,8 +147,11 @@ jobs:
144147
) &&
145148
!contains(github.event.head_commit.message, 'skip fix')
146149
run: |
147-
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
148-
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
150+
echo "PR Number - ${STEPS_CPR_OUTPUTS_PULL_REQUEST_NUMBER}"
151+
echo "PR URL - ${STEPS_CPR_OUTPUTS_PULL_REQUEST_URL}"
152+
env:
153+
STEPS_CPR_OUTPUTS_PULL_REQUEST_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
154+
STEPS_CPR_OUTPUTS_PULL_REQUEST_URL: ${{ steps.cpr.outputs.pull-request-url }}
149155

150156
# Push new commit if applicable
151157
# (for now works only on PR from same repository, not from forks)
@@ -166,7 +172,7 @@ jobs:
166172
run: sudo chown -Rc $UID .git/
167173

168174
- name: Commit and push applied linter fixes
169-
uses: stefanzweifel/git-auto-commit-action@v6
175+
uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1
170176
if: >-
171177
steps.ml.outputs.has_updated_sources == 1 &&
172178
(

0 commit comments

Comments
 (0)