Skip to content

Commit 1d53b84

Browse files
authored
chore(ci): address ossf scorecard findings on npm, pip, and top-level permission leftover (#2694)
1 parent e8399c3 commit 1d53b84

6 files changed

+27
-9
lines changed

.github/workflows/publish_v2_layer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
# therefore it ignores both activated virtual env and cached interpreter by GH
8686
run: |
8787
poetry export --format requirements.txt --output requirements.txt
88-
pip install -r requirements.txt
88+
pip install --require-hashes -r requirements.txt
8989
- name: Set up QEMU
9090
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.0.0
9191
with:
@@ -101,7 +101,7 @@ jobs:
101101
- name: install cdk and deps
102102
working-directory: ./
103103
run: |
104-
npm install
104+
npm ci
105105
npx cdk --version
106106
- name: CDK build
107107
run: npx cdk synth --verbose --context version="${{ inputs.latest_published_version }}" -o cdk.out

.github/workflows/reusable_deploy_v2_layer_stack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ jobs:
147147
# therefore it ignores both activated virtual env and cached interpreter by GH
148148
run: |
149149
poetry export --format requirements.txt --output requirements.txt
150-
pip install -r requirements.txt
150+
pip install --require-hashes -r requirements.txt
151151
- name: install cdk and deps
152152
working-directory: ./
153153
run: |
154-
npm install
154+
npm ci
155155
npx cdk --version
156156
- name: install deps
157157
run: poetry install

.github/workflows/reusable_publish_docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ on:
2828
default: develop
2929

3030
permissions:
31-
id-token: write # trade JWT token for AWS credentials in AWS Docs account
32-
contents: write # push to gh-pages
33-
pages: write # deploy gh-pages website
31+
contents: read
3432

3533
jobs:
3634
publish_docs:
@@ -40,6 +38,10 @@ jobs:
4038
group: on-docs-rebuild
4139
runs-on: ubuntu-latest
4240
environment: "Docs"
41+
permissions:
42+
contents: write # push to gh-pages
43+
id-token: write # trade JWT token for AWS credentials in AWS Docs account
44+
pages: write # uncomment if mike fails as we migrated to S3 hosting
4345
steps:
4446
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
4547
with:
@@ -110,7 +112,7 @@ jobs:
110112
# 1. Download the versions.json file from S3
111113
# 2. Find any reference to the alias and delete it from the versions file
112114
# 3. This is voodoo (don't use JQ):
113-
# - we assign the input as $o and the new version/alias as $n,
115+
# - we assign the input as $o and the new version/alias as $n,
114116
# - we check if the version number exists in the file already (for republishing docs)
115117
# - if it's an alias (stage/latest/*) or old version, we do nothing and output $o (original input)
116118
# - if it's a new version number, we add it at position 0 in the array.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
node-version: "16.12"
6767
- name: Install CDK CLI
6868
run: |
69-
npm install
69+
npm ci
7070
npx cdk --version
7171
- name: Install dependencies
7272
run: make dev

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"version": "1.0.0",
44
"devDependencies": {
55
"aws-cdk": "^2.86.0"
6+
},
7+
"dependencies": {
8+
"package-lock.json": "^1.0.0"
69
}
710
}

0 commit comments

Comments
 (0)