Skip to content

Commit abef8eb

Browse files
authored
Merge branch 'develop' into feature/metrics-aspnetcore
2 parents f8f56cf + 3016712 commit abef8eb

30 files changed

+1473
-237
lines changed

.github/workflows/build_changelog.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ name: Build changelog
44
on:
55
workflow_dispatch:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
changelog:
912
uses: ./.github/workflows/reusable_publish_changelog.yml

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
schedule:
1313
- cron: '42 8 * * 0'
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
analyze:
1720
name: Analyze

.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
if: github.repository == 'aws-powertools/powertools-lambda-dotnet'
2728
concurrency:
2829
group: analytics

.github/workflows/docs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ 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:
14+
permissions:
15+
id-token: write
16+
contents: write
1617
# Force Github action to run only a single job at a time (based on the group name)
1718
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
1819
concurrency:
@@ -46,6 +47,9 @@ jobs:
4647
dist \
4748
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-dotnet/
4849
apidocs:
50+
permissions:
51+
id-token: write
52+
contents: write
4953
# Force Github action to run only a single job at a time (based on the group name)
5054
# This is to prevent "race-condition" in publishing a new version of doc to `gh-pages`
5155
concurrency:

.github/workflows/e2e-tests.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ concurrency:
2222
group: e2e
2323

2424
permissions:
25-
id-token: write
2625
contents: read
2726

2827
jobs:
2928
deploy-stack:
29+
permissions:
30+
id-token: write
3031
runs-on: ubuntu-latest
3132
steps:
3233
- name: Checkout code
@@ -44,18 +45,25 @@ jobs:
4445
with:
4546
dotnet-version: '8.x'
4647

47-
- name: Install CDK
48-
run: npm install -g aws-cdk
48+
- name: Setup Node.js
49+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
50+
with:
51+
node-version: "22"
52+
53+
- name: Setup dependencies
54+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
4955

5056
- name: Install AWS Lambda .NET CLI Tools
5157
run: dotnet tool install -g Amazon.Lambda.Tools
5258

5359
- name: Deploy Stack
5460
run: |
5561
cd libraries/tests/e2e/infra
56-
cdk deploy --all --require-approval never
62+
npx cdk deploy --all --require-approval never
5763
5864
deploy-aot-stack:
65+
permissions:
66+
id-token: write
5967
strategy:
6068
matrix:
6169
os: [ubuntu-24.04-arm, ubuntu-latest]
@@ -81,18 +89,25 @@ jobs:
8189
with:
8290
dotnet-version: '8.x'
8391

84-
- name: Install CDK
85-
run: npm install -g aws-cdk
92+
- name: Setup Node.js
93+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
94+
with:
95+
node-version: "22"
96+
97+
- name: Setup dependencies
98+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
8699

87100
- name: Install AWS Lambda .NET CLI Tools
88101
run: dotnet tool install -g Amazon.Lambda.Tools
89102

90103
- name: Deploy AOT Stack
91104
run: |
92105
cd libraries/tests/e2e/infra-aot
93-
cdk deploy --all -c architecture=${{ matrix.arch }} --require-approval never
106+
npx cdk deploy --all -c architecture=${{ matrix.arch }} --require-approval never
94107
95108
run-tests:
109+
permissions:
110+
id-token: write
96111
strategy:
97112
matrix:
98113
utility: [core, idempotency]
@@ -126,6 +141,8 @@ jobs:
126141
dotnet test --filter Category=AOT
127142
128143
destroy-stack:
144+
permissions:
145+
id-token: write
129146
runs-on: ubuntu-latest
130147
needs: run-tests
131148
if: always()
@@ -140,18 +157,25 @@ jobs:
140157
aws-region: us-east-1
141158
mask-aws-account-id: true
142159

143-
- name: Install CDK
144-
run: npm install -g aws-cdk
160+
- name: Setup Node.js
161+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
162+
with:
163+
node-version: "22"
164+
165+
- name: Setup dependencies
166+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
145167

146168
- name: Install AWS Lambda .NET CLI Tools
147169
run: dotnet tool install -g Amazon.Lambda.Tools
148170

149171
- name: Destroy Stack
150172
run: |
151173
cd libraries/tests/e2e/infra
152-
cdk destroy --all --force
174+
npx cdk destroy --all --force
153175
154176
destroy-aot-stack:
177+
permissions:
178+
id-token: write
155179
strategy:
156180
matrix:
157181
os: [ubuntu-24.04-arm, ubuntu-latest]
@@ -174,14 +198,19 @@ jobs:
174198
aws-region: us-east-1
175199
mask-aws-account-id: true
176200

177-
- name: Install CDK
178-
run: npm install -g aws-cdk
201+
- name: Setup Node.js
202+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
203+
with:
204+
node-version: "22"
205+
206+
- name: Setup dependencies
207+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
179208

180209
- name: Install AWS Lambda .NET CLI Tools
181210
run: dotnet tool install -g Amazon.Lambda.Tools
182211

183212
- name: Destroy arm64 AOT Stack
184213
run: |
185214
cd libraries/tests/e2e/infra-aot
186-
cdk destroy --all -c architecture=${{ matrix.arch }} --force
215+
npox cdk destroy --all -c architecture=${{ matrix.arch }} --force
187216

.github/workflows/label_pr_on_title.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
get_pr_details:
14+
permissions:
15+
id-token: write
1116
# Guardrails to only ever run if PR recording workflow was indeed
1217
# run in a PR event and ran successfully
1318
if: ${{ github.event.workflow_run.conclusion == 'success' }}
@@ -18,6 +23,8 @@ jobs:
1823
secrets:
1924
token: ${{ secrets.GITHUB_TOKEN }}
2025
label_pr:
26+
permissions:
27+
id-token: write
2128
needs: get_pr_details
2229
runs-on: ubuntu-latest
2330
steps:

.github/workflows/on_label_added.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
get_pr_details:
14+
permissions:
15+
id-token: write
1116
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1217
uses: ./.github/workflows/reusable_export_pr_details.yml
1318
with:
@@ -20,8 +25,10 @@ jobs:
2025
needs: get_pr_details
2126
runs-on: ubuntu-latest
2227
permissions:
28+
contents: read
2329
issues: write
2430
pull-requests: write
31+
id-token: write
2532
steps:
2633
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2734
# Maintenance: Persist state per PR as an artifact to avoid spam on label add

.github/workflows/on_merged_pr.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
get_pr_details:
14+
permissions:
15+
contents: read
16+
id-token: write
1117
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
1218
uses: ./.github/workflows/reusable_export_pr_details.yml
1319
with:
@@ -16,6 +22,9 @@ jobs:
1622
secrets:
1723
token: ${{ secrets.GITHUB_TOKEN }}
1824
release_label_on_merge:
25+
permissions:
26+
contents: read
27+
id-token: write
1928
needs: get_pr_details
2029
runs-on: ubuntu-latest
2130
if: needs.get_pr_details.outputs.prIsMerged == 'true'

.github/workflows/on_opened_pr.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
get_pr_details:
14+
permissions:
15+
id-token: write
1116
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1217
uses: ./.github/workflows/reusable_export_pr_details.yml
1318
with:
@@ -16,6 +21,9 @@ jobs:
1621
secrets:
1722
token: ${{ secrets.GITHUB_TOKEN }}
1823
check_related_issue:
24+
permissions:
25+
contents: read
26+
id-token: write
1927
needs: get_pr_details
2028
runs-on: ubuntu-latest
2129
steps:

.github/workflows/ossf_scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
schedule:
77
- cron: "0 9 * * *"
88
push:
9-
branches: [main]
9+
branches: [develop]
1010
workflow_dispatch:
1111

1212
permissions: read-all

.github/workflows/rebuild_latest_docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
description: "Latest PyPi published version to rebuild latest docs for, e.g. 2.0.0"
1414
default: "2.0.0"
1515
required: true
16+
17+
permissions:
18+
contents: read
1619

1720
jobs:
1821
changelog:

.github/workflows/record_pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
types: [opened, edited, closed]
66

7+
8+
permissions:
9+
contents: read
10+
711
jobs:
812
record_pr:
913
runs-on: ubuntu-latest

.github/workflows/release-drafter.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
- develop
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
update_release_draft:
14+
permissions:
15+
id-token: write
1116
runs-on: ubuntu-latest
1217
steps:
1318
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v5.20.1

.github/workflows/reusable_export_pr_details.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ on:
3636
description: "Whether PR is merged"
3737
value: ${{ jobs.export_pr_details.outputs.prIsMerged }}
3838

39+
permissions:
40+
contents: read
41+
3942
jobs:
4043
export_pr_details:
44+
permissions:
45+
id-token: write
4146
# see https://github.com/aws-powertools/powertools-lambda-python/issues/1349
4247
if: inputs.workflow_origin == 'aws-powertools/powertools-lambda-dotnet'
4348
runs-on: ubuntu-latest

.github/workflows/reusable_publish_changelog.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ on:
44
workflow_call:
55

66
permissions:
7-
contents: write
7+
contents: read
88

99
env:
1010
BRANCH: develop
1111

1212
jobs:
1313
publish_changelog:
14+
permissions:
15+
contents: write
1416
# Force Github action to run only a single job at a time (based on the group name)
1517
# This is to prevent race-condition and inconsistencies with changelog push
1618
concurrency:

0 commit comments

Comments
 (0)