Skip to content

fix(ci): Workflow permissions #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ jobs:
with:
dotnet-version: '8.x'

- name: Install CDK
run: npm install
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: "22"

- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0

- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools
Expand Down Expand Up @@ -84,8 +89,13 @@ jobs:
with:
dotnet-version: '8.x'

- name: Install CDK
run: npm install
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: "22"

- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0

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

- name: Install CDK
run: npm install
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: "22"

- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0

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

- name: Install CDK
run: npm install
- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: "22"

- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0

- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on_label_added.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
needs: get_pr_details
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
id-token: write
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on_merged_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
get_pr_details:
permissions:
contents: read
id-token: write
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/reusable_export_pr_details.yml
Expand All @@ -22,6 +23,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
release_label_on_merge:
permissions:
contents: read
id-token: write
needs: get_pr_details
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on_opened_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
check_related_issue:
permissions:
contents: read
id-token: write
needs: get_pr_details
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ossf_scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
schedule:
- cron: "0 9 * * *"
push:
branches: [main]
branches: [develop]
workflow_dispatch:

permissions: read-all
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build-image
# 6.0-bullseye-slim
FROM mcr.microsoft.com/dotnet/sdk@sha256:fc71510497ce2ec3575359068b9c7b1b9f449cfdb0371b5c71a939963a2fedfd AS build-image

ARG FUNCTION_DIR="/build"
ARG SAM_BUILD_MODE="run"
Expand Down
Loading