Skip to content

Commit 7c30a4c

Browse files
authored
👷 Remove un-allowlisted actions (#1086)
1 parent 42c33ff commit 7c30a4c

File tree

7 files changed

+72
-90
lines changed

7 files changed

+72
-90
lines changed

.github/workflows/code-qualitiy.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ jobs:
2727
with:
2828
java-version: '17'
2929
distribution: 'temurin'
30-
- name: Set up Maven
31-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
32-
with:
33-
maven-version: 3.9.6
3430
- name: mvn clean verify
3531
run: mvn clean verify
3632
- name: Build with Maven
@@ -64,10 +60,6 @@ jobs:
6460
with:
6561
java-version: '17'
6662
distribution: 'temurin'
67-
- name: Set up Maven
68-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
69-
with:
70-
maven-version: 3.9.6
7163
- name: Build with Maven
7264
run: mvn --batch-mode --update-snapshots clean install
7365
- name: Run reproducibility check

.github/workflows/doc.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ jobs:
2525
repository: ${{ github.event.pull_request.head.repo.full_name }}
2626
ref: ${{ github.event.pull_request.head.ref }}
2727
token: ${{ secrets.GITHUB_TOKEN }}
28-
- name: Set up Maven
29-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
30-
with:
31-
maven-version: 3.9.6
3228
- name: Generate action.yml
3329
run: mvn generate-resources resources:copy-resources -q
3430
- name: Run Maven Spotless
@@ -44,6 +40,6 @@ jobs:
4440
fi
4541
- name: Commit changes
4642
if: steps.check_changes.outputs.changes == 'true'
47-
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
43+
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # 5.1.0
4844
with:
49-
message: "📝 Update Documentation with current version"
45+
commit_message: "📝 Update Documentation with current version"

.github/workflows/jreleaser.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ jobs:
3434
java-version: '17'
3535
distribution: 'temurin'
3636
cache: maven
37-
- name: Set up Maven
38-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
39-
with:
40-
maven-version: 3.9.6
4137
- name: Set git user
4238
run: |
4339
git config --global user.name "GitHub Actions Bot"

.github/workflows/smoke-tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,9 @@ jobs:
4141
with:
4242
java-version: '17'
4343
distribution: 'temurin'
44-
- name: Set up Maven
45-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
46-
with:
47-
maven-version: 3.9.6
48-
- name: jbang
49-
uses: jbangdev/setup-jbang@2b1b465a7b75f4222b81426f23a01e013aa7b95c # v0.1.1
50-
with:
51-
version: 0.119.0
44+
- id: install-jbang
45+
run: curl -Ls https://sh.jbang.dev | bash -s - app setup
46+
shell: bash
5247
- name: SmokeTest
5348
run: |
5449
jbang .github/smoketest/SmokeTest.java

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,41 @@ It still works for pull requests from the same repository. Renovate also works w
187187
188188
### Arguments
189189
190-
- `github-token` (required): The GitHub token used to commit the lockfile to the repository.
191-
- `commit-lockfile` (optional, default=true): Whether to commit an updated lockfile to the repository. The action can be used to update lockfiles automatically in e.g. pull requests (se warning about pull-requests from forks). If this is true and the pom.xml or workflow-file has updated it will create and commit the new lockfile - the action **will not** fail if the lockfile is outdated or invalid and only push the correct version. If this is false or the pom.xml and workflow-file remain unchanged, the action be used to verify the lockfile is correct - the action **will** fail in case of an outdated or invalid lockfile.
192-
- `commit-message` (optional, default='chore: update lockfile'): The commit message for the lockfile if `commit-lockfile` is true.
193-
- `commit-author` (optional, default='github\_actions'): The author for the lockfile commit if `commit-lockfile` is true. GitHub provides three values for this field.
194-
- github\_actor -> `UserName <[email protected]>`
195-
- user\_info -> `Your Display Name <[email protected]>`
196-
- github\_actions -> `github-actions <email associated with the github logo>`
197-
- `include-maven-plugins` (optional, default='false'): Whether to include Maven plugins in the lockfile.
198-
- `lockfile-name` (optional, default="lockfile.json"): The name of the lockfile to generate/validate.
199-
- `workflow-filename` (optional, default='Lockfile.yml'): The name of the workflow file, to automatically trigger lockfile generation when the workflow is updated.
190+
Extended github actions example with all available options:
191+
192+
```yml
193+
- uses: chains-project/maven-lockfile@bdabb56b82feb242cd543af007b333bd8276e44e # v5.3.5
194+
with:
195+
# Required. The GitHub token used to commit the updated lockfile to the repository.
196+
- github-token: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
197+
198+
# Optional. Whether to commit an updated lockfile to the repository. The action can be used
199+
# to update lockfiles automatically in e.g. pull requests (se warning about pull-requests
200+
# from forks). If this is true and the pom.xml or workflow-file has updated it will create
201+
# and commit the new lockfile - the action **will not** fail if the lockfile is outdated
202+
# or invalid and only push the correct version. If this is false or the pom.xml and
203+
# workflow-file remain unchanged, the action be used to verify the lockfile is correct -
204+
# the action **will** fail in case of an outdated or invalid lockfile.
205+
# Defaults to true.
206+
- commit-lockfile: true
207+
208+
# Optional. The commit message for the lockfile if 'commit-lockfile' is true.
209+
# Defaults to 'chore: update lockfile'
210+
- commit-message: 'chore: update lockfile'
211+
212+
# Optional. Wether to include Maven plugins in the lockfile.
213+
# Defaults to false.
214+
- include-maven-plugins: false
215+
216+
# Optional. The name of the lockfile to generate/validate.
217+
# Defaults to 'lockfile.json'.
218+
- lockfile-name: 'lockfile.json'
219+
220+
# Optional. The name of the workflow file, to automatically trigger lockfile generation with
221+
# the workflow is updated.
222+
# Defaults to 'Lockfile.yml'
223+
workflow-filename: 'Lockfile.yml'
224+
```
200225
201226
### Using Action in Release with `-SNAPSHOT`-versions (synchronizing lockfile with release)
202227

action.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ inputs:
1515
description: 'Commit message for the lockfile'
1616
required: false
1717
default: 'chore: update lockfile'
18-
commit-author:
19-
description: |
20-
'
21-
Author for the lockfile commit. GitHub provides three values for this field.
22-
- github_actor -> UserName <[email protected]>
23-
- user_info -> Your Display Name <[email protected]>
24-
- github_actions -> github-actions <email associated with the github logo
25-
'
26-
required: false
27-
default: 'github_actions'
2818
include-maven-plugins:
2919
description: 'Include Maven plugins in the lockfile'
3020
required: false
@@ -53,25 +43,25 @@ runs:
5343
java-version: '17'
5444
distribution: 'temurin'
5545
cache: maven
56-
- name: Set up Maven
57-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
58-
with:
59-
maven-version: 3.8.2
6046
- id: install-jbang
6147
run: curl -Ls https://sh.jbang.dev | bash -s - app setup
6248
shell: bash
63-
- name: Get all changed pom.xml and lockfile.json file(s)
64-
id: changed-files
65-
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45
66-
with:
67-
files: |
68-
**/pom.xml
69-
**/${{ inputs.workflow-filename}}
70-
- name: print all changed files
71-
run: echo all changed files are ${{ steps.changed-files.outputs.all_changed_files }}
49+
- name: Get all changed pom.xml and workflow file(s)
50+
id: detect-changes
51+
run: |
52+
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- '**/pom.xml' '**/${{ inputs.workflow-filename }}')
53+
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
54+
shell: bash
55+
- name: Print all changed files
56+
run: echo "All changed files are $CHANGED_FILES"
7257
shell: bash
7358
- name: Set POM_CHANGED environment variable
74-
run: echo "POM_CHANGED=${{ steps.changed-files.outputs.any_changed}}" >> $GITHUB_ENV
59+
run: |
60+
if [[ -n "$CHANGED_FILES" ]]; then
61+
echo "POM_CHANGED=true" >> $GITHUB_ENV
62+
else
63+
echo "POM_CHANGED=false" >> $GITHUB_ENV
64+
fi
7565
shell: bash
7666
- name: print POM-CHANGED
7767
run: echo "pom changed ${{ env.POM_CHANGED }}"
@@ -87,7 +77,6 @@ runs:
8777
GITHUB_TOKEN: ${{ inputs.github-token }}
8878
- id: commit-lockfile
8979
if: inputs.commit-lockfile == 'true'
90-
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
80+
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # 5.1.0
9181
with:
92-
default_author: ${{ inputs.commit-author }}
93-
message: ${{ inputs.commit-message }}
82+
commit_message: ${{ inputs.commit-message }}

template/action.yml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ inputs:
1515
description: 'Commit message for the lockfile'
1616
required: false
1717
default: 'chore: update lockfile'
18-
commit-author:
19-
description: |
20-
'
21-
Author for the lockfile commit. GitHub provides three values for this field.
22-
- github_actor -> UserName <[email protected]>
23-
- user_info -> Your Display Name <[email protected]>
24-
- github_actions -> github-actions <email associated with the github logo
25-
'
26-
required: false
27-
default: 'github_actions'
2818
include-maven-plugins:
2919
description: 'Include Maven plugins in the lockfile'
3020
required: false
@@ -53,25 +43,25 @@ runs:
5343
java-version: '17'
5444
distribution: 'temurin'
5545
cache: maven
56-
- name: Set up Maven
57-
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
58-
with:
59-
maven-version: 3.8.2
6046
- id: install-jbang
6147
run: curl -Ls https://sh.jbang.dev | bash -s - app setup
6248
shell: bash
63-
- name: Get all changed pom.xml and lockfile.json file(s)
64-
id: changed-files
65-
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45
66-
with:
67-
files: |
68-
**/pom.xml
69-
**/${{ inputs.workflow-filename}}
70-
- name: print all changed files
71-
run: echo all changed files are ${{ steps.changed-files.outputs.all_changed_files }}
49+
- name: Get all changed pom.xml and workflow file(s)
50+
id: detect-changes
51+
run: |
52+
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} -- '**/pom.xml' '**/${{ inputs.workflow-filename }}')
53+
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
54+
shell: bash
55+
- name: Print all changed files
56+
run: echo "All changed files are $CHANGED_FILES"
7257
shell: bash
7358
- name: Set POM_CHANGED environment variable
74-
run: echo "POM_CHANGED=${{ steps.changed-files.outputs.any_changed}}" >> $GITHUB_ENV
59+
run: |
60+
if [[ -n "$CHANGED_FILES" ]]; then
61+
echo "POM_CHANGED=true" >> $GITHUB_ENV
62+
else
63+
echo "POM_CHANGED=false" >> $GITHUB_ENV
64+
fi
7565
shell: bash
7666
- name: print POM-CHANGED
7767
run: echo "pom changed ${{ env.POM_CHANGED }}"
@@ -87,7 +77,6 @@ runs:
8777
GITHUB_TOKEN: ${{ inputs.github-token }}
8878
- id: commit-lockfile
8979
if: inputs.commit-lockfile == 'true'
90-
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
80+
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # 5.1.0
9181
with:
92-
default_author: ${{ inputs.commit-author }}
93-
message: ${{ inputs.commit-message }}
82+
commit_message: ${{ inputs.commit-message }}

0 commit comments

Comments
 (0)