Skip to content

Commit 6ac6822

Browse files
authored
Merge branch 'main' into main
2 parents b71e9a3 + 51956d8 commit 6ac6822

File tree

74 files changed

+2888
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2888
-220
lines changed

.github/workflows/auto-merge.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/workflows/build-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
- 'mkdocs.yml'
1919
- 'Makefile'
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
docs:
2326
runs-on: ubuntu-latest

.github/workflows/dispatch_analytics.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@ on:
77
- cron: '0 * * * *'
88

99
permissions:
10-
id-token: write
11-
actions: read
12-
checks: read
1310
contents: read
14-
deployments: read
15-
issues: read
16-
discussions: read
17-
packages: read
18-
pages: read
19-
pull-requests: read
20-
repository-projects: read
21-
security-events: read
22-
statuses: read
2311

2412
jobs:
2513
dispatch_token:
14+
permissions:
15+
id-token: write
16+
actions: read
17+
checks: read
18+
deployments: read
19+
issues: read
20+
discussions: read
21+
packages: read
22+
pages: read
23+
pull-requests: read
24+
repository-projects: read
25+
security-events: read
26+
statuses: read
2627
concurrency:
2728
group: analytics
2829
runs-on: ubuntu-latest

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
workflow_dispatch: {}
88

99
permissions:
10-
id-token: write
11-
contents: write
12-
pages: write
10+
contents: read
1311

1412
jobs:
1513
docs:
1614
runs-on: ubuntu-latest
1715
environment: Docs
16+
permissions:
17+
id-token: write
1818
steps:
1919
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2020
- name: Set up Python
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
schedule:
7+
- cron: "0 9 * * *"
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
permissions: read-all
13+
14+
jobs:
15+
analysis:
16+
name: Scorecard analysis
17+
runs-on: ubuntu-latest
18+
# environment: scorecard
19+
permissions:
20+
security-events: write # update code-scanning dashboard
21+
id-token: write # confirm org+repo identity before publish results
22+
23+
steps:
24+
- name: "Checkout code"
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
with:
27+
persist-credentials: false
28+
29+
- name: "Run analysis"
30+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
31+
with:
32+
results_file: results.sarif
33+
results_format: sarif
34+
publish_results: true # publish to OSSF Scorecard REST API
35+
# repo_token: ${{ secrets.SCORECARD_TOKEN }} # read-only fine-grained token to read branch protection settings
36+
37+
- name: "Upload results"
38+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
39+
with:
40+
name: SARIF file
41+
path: results.sarif
42+
retention-days: 5
43+
44+
# Upload the results to GitHub's code scanning dashboard.
45+
- name: "Upload to code-scanning"
46+
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
47+
with:
48+
sarif_file: results.sarif

.github/workflows/osv.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: OSV-Scanner
2+
3+
# Change "main" to your default branch if you use a different name, i.e. "master"
4+
on:
5+
pull_request:
6+
branches: [main]
7+
merge_group:
8+
branches: [main]
9+
workflow_dispatch: {}
10+
11+
schedule:
12+
- cron: "30 12 * * 1"
13+
# Change "main" to your default branch if you use a different name, i.e. "master"
14+
push:
15+
branches: [main]
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
scan-pr:
22+
permissions:
23+
actions: read
24+
contents: read
25+
security-events: write
26+
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@764c91816374ff2d8fc2095dab36eecd42d61638"

.github/workflows/pr_artifacts_size.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ on:
2323
- 'powertools-validation/**'
2424
- 'pom.xml'
2525
- '.github/workflows/pr_artifacts_size.yml'
26+
27+
permissions:
28+
contents: read
29+
2630
jobs:
2731
codecheck:
2832
runs-on: ubuntu-latest

.github/workflows/pr_build.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
branches:
67
- main
@@ -45,6 +46,10 @@ on:
4546
- 'pom.xml'
4647
- 'examples/pom.xml'
4748
- '.github/workflows/**'
49+
50+
permissions:
51+
contents: read
52+
4853
jobs:
4954
build-corretto:
5055
runs-on: ubuntu-latest
@@ -58,7 +63,6 @@ jobs:
5863
AWS_REGION: eu-west-1
5964
permissions:
6065
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
61-
contents: read
6266
steps:
6367
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
6468
- name: Setup java
@@ -69,14 +73,30 @@ jobs:
6973
cache: 'maven'
7074
- name: Build with Maven
7175
run: mvn -B install --file pom.xml
76+
- name: Build Gradle Setup
77+
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
78+
working-directory: examples/powertools-examples-core/gradle
79+
run: |
80+
curl -L -o gradle/wrapper/gradle.zip https:$(cat gradle/wrapper/gradle-wrapper.properties | grep distributionUrl | cut -d ':' -f 2)
81+
unzip gradle/wrapper/gradle.zip -d gradle/wrapper/gradle
82+
./gradle/wrapper/gradle/gradle-8.2.1/bin/gradle wrapper
7283
- name: Build Gradle Example - Java
7384
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
7485
working-directory: examples/powertools-examples-core/gradle
7586
run: ./gradlew build
87+
88+
- name: Build Gradle Setup (Kotlin)
89+
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
90+
working-directory: examples/powertools-examples-core/kotlin
91+
run: |
92+
curl -L -o gradle/wrapper/gradle.zip https:$(cat gradle/wrapper/gradle-wrapper.properties | grep distributionUrl | cut -d ':' -f 2)
93+
unzip gradle/wrapper/gradle.zip -d gradle/wrapper/gradle
94+
./gradle/wrapper/gradle/gradle-8.2.1/bin/gradle wrapper
7695
- name: Build Gradle Example - Kotlin
7796
if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8
7897
working-directory: examples/powertools-examples-core/kotlin
7998
run: ./gradlew build
99+
80100
- name: Upload coverage to Codecov
81101
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
82102
if: ${{ matrix.java == '11' }} # publish results once

.github/workflows/pr_build_v2.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ on:
4141
- 'pom.xml'
4242
- 'examples/pom.xml'
4343
- '.github/workflows/**'
44+
45+
permissions:
46+
contents: read
47+
4448
jobs:
4549
build-corretto:
4650
runs-on: ubuntu-latest
@@ -54,7 +58,6 @@ jobs:
5458
AWS_REGION: eu-west-1
5559
permissions:
5660
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
57-
contents: read
5861
steps:
5962
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
6063
- name: Setup java

.github/workflows/pr_iac_lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- v2
1212
paths:
1313
- 'examples/**'
14+
15+
permissions:
16+
contents: read
17+
1418
jobs:
1519
linter:
1620
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@ on:
44
types:
55
- published
66
workflow_dispatch: {}
7+
8+
permissions:
9+
contents: read
10+
711
jobs:
812
publish:
913
runs-on: ubuntu-latest
14+
environment: Release
15+
permissions:
16+
id-token: write
17+
issues: write
18+
contents: write
1019
steps:
1120
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
1221
- name: Set up Maven Central Repository

.github/workflows/release-drafter.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
update_release_draft:
1114
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
id-token: write
1218
steps:
1319
- uses: release-drafter/release-drafter@569eb7ee3a85817ab916c8f8ff03a5bd96c9c83e # v5.23.0
1420
env:

.github/workflows/release-prep.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ on:
66
description: 'Release number to upgrade to. For example X.X.X. Follow Semantic Versioning when deciding on next version.'
77
required: true
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
15+
permissions:
16+
id-token: write
17+
pull-requests: write
18+
contents: write
1219
steps:
1320
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
1421
- name: Get current date
@@ -69,12 +76,11 @@ jobs:
6976
uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3.14.0
7077
with:
7178
commit-message: chore:prep release ${{ github.event.inputs.targetRelease }}
72-
token: ${{ secrets.RELEASE }}
7379
signoff: false
7480
branch: prep-release-${{ github.event.inputs.targetRelease }}
7581
delete-branch: true
7682
title: chore:Prep release ${{ github.event.inputs.targetRelease }}
7783
body: |
7884
This is automated release prep. Remember to update [CHANGELOG.md](https://github.com/aws-powertools/powertools-lambda-java/blob/prep-release-${{ github.event.inputs.targetRelease }}/CHANGELOG.md) to capture changes in this release. Please review changes carefully before merging.
7985
80-
* [ ] Updated CHANGELOG.md
86+
* [ ] Updated CHANGELOG.md

.github/workflows/run-e2e-tests-v2.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ on:
2727
paths:
2828
- 'powertools-e2e-tests/**'
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
e2e:
3235
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)