Skip to content

Commit 6525277

Browse files
committed
Address zizmor GitHub Actions findings
Fixes findings identified by zizmor (https://github.com/zizmorcore/zizmor) Signed-off-by: nscuro <nscuro@protonmail.com>
1 parent 3dd0caf commit 6525277

6 files changed

Lines changed: 43 additions & 12 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ updates:
55
directory: /
66
schedule:
77
interval: daily
8+
cooldown:
9+
default-days: 7
810
- package-ecosystem: docker
911
directory: /docker
1012
schedule:
1113
interval: daily
14+
cooldown:
15+
default-days: 7
1216
- package-ecosystem: github-actions
1317
directory: /
1418
schedule:
1519
interval: daily
20+
cooldown:
21+
default-days: 7
1622
# Receive minor and patch updates on latest release branch.
1723
# Ignore minor releases for NPM since they may ship breaking
1824
# changes, and we don't have the test coverage in place to
@@ -22,6 +28,8 @@ updates:
2228
directory: /
2329
schedule:
2430
interval: daily
31+
cooldown:
32+
default-days: 7
2533
ignore:
2634
- dependency-name: "*"
2735
update-types:
@@ -32,6 +40,8 @@ updates:
3240
directory: /docker
3341
schedule:
3442
interval: daily
43+
cooldown:
44+
default-days: 7
3545
ignore:
3646
- dependency-name: "*"
3747
update-types:

.github/workflows/_meta-build.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
steps:
3131
- name: Checkout Repository
3232
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
33+
with:
34+
persist-credentials: false
3335

3436
- name: Set up NodeJs
3537
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # tag=v6.3.0
@@ -60,6 +62,8 @@ jobs:
6062
steps:
6163
- name: Checkout Repository
6264
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
65+
with:
66+
persist-credentials: false
6367

6468
- name: Download Artifacts
6569
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # tag=v8.0.0
@@ -85,16 +89,18 @@ jobs:
8589

8690
- name: Set Container Tags
8791
id: tags
92+
env:
93+
REF_NAME: ${{ inputs.ref-name }}
94+
APP_VERSION: ${{ inputs.app-version }}
8895
run: |-
8996
IMAGE_NAME="docker.io/dependencytrack/frontend"
90-
REF_NAME="${{ inputs.ref-name }}"
9197
TAGS=""
9298
9399
if [[ $REF_NAME == feature-* ]]; then
94100
TAGS="${IMAGE_NAME}:${REF_NAME,,}"
95101
else
96-
TAGS="${IMAGE_NAME}:${{ inputs.app-version }}"
97-
if [[ "${{ inputs.app-version }}" != "snapshot" ]]; then
102+
TAGS="${IMAGE_NAME}:${APP_VERSION}"
103+
if [[ "${APP_VERSION}" != "snapshot" ]]; then
98104
TAGS="${TAGS},${IMAGE_NAME}:latest"
99105
fi
100106
fi

.github/workflows/ci-publish.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
2424
- name: Checkout Repository
2525
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
26+
with:
27+
persist-credentials: false
2628

2729
- name: Parse Version from package.json
2830
id: parse
@@ -52,6 +54,8 @@ jobs:
5254
steps:
5355
- name: Checkout Repository
5456
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
57+
with:
58+
persist-credentials: false
5559

5660
- name: Download Artifacts
5761
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # tag=v8.0.0
@@ -72,20 +76,21 @@ jobs:
7276
- name: Update Release
7377
env:
7478
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
RELEASE_VERSION: ${{ needs.read-version.outputs.version }}
7580
run: |-
7681
cat << EOF >> .github/default-release-notes.md
7782
\`\`\`text
7883
$(cat checksums.txt)
7984
\`\`\`
8085
EOF
8186
82-
gh release view ${{ needs.read-version.outputs.version }} \
87+
gh release view "${RELEASE_VERSION}" \
8388
--json body --jq .body >> .github/default-release-notes.md
8489
85-
gh release edit ${{ needs.read-version.outputs.version }} \
90+
gh release edit "${RELEASE_VERSION}" \
8691
--notes-file ".github/default-release-notes.md"
8792
88-
gh release upload ${{ needs.read-version.outputs.version }} \
93+
gh release upload "${RELEASE_VERSION}" \
8994
--clobber \
9095
frontend-dist.zip \
9196
checksums.txt \
@@ -94,6 +99,7 @@ jobs:
9499
- name: Publish Release
95100
env:
96101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
RELEASE_VERSION: ${{ needs.read-version.outputs.version }}
97103
run: |-
98-
gh release edit ${{ needs.read-version.outputs.version }} \
104+
gh release edit "${RELEASE_VERSION}" \
99105
--draft=false

.github/workflows/ci-release.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,32 @@ jobs:
3434
cache: 'npm'
3535

3636
- name: Bump version and tag via NodeJS
37+
env:
38+
VERSION_TO_BUMP: ${{ github.event.inputs.version-to-bump }}
39+
GIT_REF: ${{ github.ref }}
3740
run: |-
3841
git config user.name "dependencytrack-bot"
3942
git config user.email "106437498+dependencytrack-bot@users.noreply.github.com"
4043
41-
npm version ${{ github.event.inputs.version-to-bump }} -m "prepare-release: set version to %s"
44+
npm version "${VERSION_TO_BUMP}" -m "prepare-release: set version to %s"
4245
43-
git push origin "HEAD:${{ github.ref }}"
46+
git push origin "HEAD:${GIT_REF}"
4447
4548
- name: Create GitHub Release
4649
env:
4750
GITHUB_TOKEN: ${{ secrets.BOT_RELEASE_TOKEN }}
48-
GH_OPTS: ''
51+
VERSION_TO_BUMP: ${{ github.event.inputs.version-to-bump }}
52+
GIT_REF_NAME: ${{ github.ref_name }}
4953
run: |-
5054
VERSION=`jq -r '.version' package.json`
55+
GH_OPTS=""
5156
52-
if [[ "${{ contains(github.event.inputs.version-to-bump, 'pre') }}" == "true" ]]; then
57+
if [[ "${VERSION_TO_BUMP}" == *pre* ]]; then
5358
GH_OPTS="--prerelease"
5459
fi
5560
5661
gh release create "${VERSION}" ${GH_OPTS} \
57-
--target "${{ github.ref_name }}" \
62+
--target "${GIT_REF_NAME}" \
5863
--title "${VERSION}" \
5964
--draft \
6065
--generate-notes

.github/workflows/i18n.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- name: Checkout Repository
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
21+
with:
22+
persist-credentials: false
2123

2224
- name: Set up NodeJs
2325
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # tag=v6.3.0

.github/workflows/lint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- name: Checkout Repository
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
21+
with:
22+
persist-credentials: false
2123

2224
- name: Set up NodeJs
2325
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # tag=v6.3.0

0 commit comments

Comments
 (0)