Skip to content

Commit 1191422

Browse files
sthulbhjgraca
authored andcommitted
fix(ci): Workflow permissions (#774)
* fix(ci): Update image * add aws-cdk-lib * update branch to check * permissions added * use cached deps for node
1 parent b7855ad commit 1191422

8 files changed

+436
-12
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ jobs:
4545
with:
4646
dotnet-version: '8.x'
4747

48-
- name: Install CDK
49-
run: npm install
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
5055

5156
- name: Install AWS Lambda .NET CLI Tools
5257
run: dotnet tool install -g Amazon.Lambda.Tools
@@ -84,8 +89,13 @@ jobs:
8489
with:
8590
dotnet-version: '8.x'
8691

87-
- name: Install CDK
88-
run: npm install
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
8999

90100
- name: Install AWS Lambda .NET CLI Tools
91101
run: dotnet tool install -g Amazon.Lambda.Tools
@@ -147,8 +157,13 @@ jobs:
147157
aws-region: us-east-1
148158
mask-aws-account-id: true
149159

150-
- name: Install CDK
151-
run: npm install
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
152167

153168
- name: Install AWS Lambda .NET CLI Tools
154169
run: dotnet tool install -g Amazon.Lambda.Tools
@@ -183,8 +198,13 @@ jobs:
183198
aws-region: us-east-1
184199
mask-aws-account-id: true
185200

186-
- name: Install CDK
187-
run: npm install
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
188208

189209
- name: Install AWS Lambda .NET CLI Tools
190210
run: dotnet tool install -g Amazon.Lambda.Tools

.github/workflows/on_label_added.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
needs: get_pr_details
2626
runs-on: ubuntu-latest
2727
permissions:
28+
contents: read
2829
issues: write
2930
pull-requests: write
3031
id-token: write

.github/workflows/on_merged_pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212
jobs:
1313
get_pr_details:
1414
permissions:
15+
contents: read
1516
id-token: write
1617
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
1718
uses: ./.github/workflows/reusable_export_pr_details.yml
@@ -22,6 +23,7 @@ jobs:
2223
token: ${{ secrets.GITHUB_TOKEN }}
2324
release_label_on_merge:
2425
permissions:
26+
contents: read
2527
id-token: write
2628
needs: get_pr_details
2729
runs-on: ubuntu-latest

.github/workflows/on_opened_pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
token: ${{ secrets.GITHUB_TOKEN }}
2323
check_related_issue:
2424
permissions:
25+
contents: read
2526
id-token: write
2627
needs: get_pr_details
2728
runs-on: ubuntu-latest

.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

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build-image
1+
# 6.0-bullseye-slim
2+
FROM mcr.microsoft.com/dotnet/sdk@sha256:fc71510497ce2ec3575359068b9c7b1b9f449cfdb0371b5c71a939963a2fedfd AS build-image
23

34
ARG FUNCTION_DIR="/build"
45
ARG SAM_BUILD_MODE="run"

0 commit comments

Comments
 (0)