Skip to content

Commit d0cdd01

Browse files
committed
Recommend Action pinning (#90)
1 parent b7dae83 commit d0cdd01

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ GitHub Action for Maven based projects.
88

99
It checks out the repository, sets up Java, runs Maven and optional analysis.
1010

11-
### Example
11+
### Recommendation
12+
13+
Instead of using a tag or branch, pinning to a full-length commit is recommended.
14+
[Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot) helps to keep GH Actions up to date.
15+
16+
### Examples
1217

1318
Minimal example:
1419

1520
```yml
16-
- uses: offa/maven-action@main
21+
# Replace '<commit>' with the latest commit on main
22+
- uses: offa/maven-action@<commit>
1723
with:
1824
java-version: '21'
1925
```
@@ -32,7 +38,7 @@ jobs:
3238
name: jdk-${{ matrix.java }}
3339
steps:
3440
- name: Build
35-
uses: offa/maven-action@main
41+
uses: offa/maven-action@<commit>
3642
with:
3743
java-version: ${{ matrix.java }}
3844
pmd: true
@@ -43,7 +49,8 @@ jobs:
4349
`java-version` is required, all other settings are optional with defaults
4450

4551
```yml
46-
- uses: offa/maven-action@main
52+
# Replace '<commit>' the the current main commit
53+
- uses: offa/maven-action@<commit>
4754
with:
4855
# Java version to use (required) - whole or semver Java version
4956
java-version: # Required

0 commit comments

Comments
 (0)