Skip to content

Commit 8501e14

Browse files
authored
[DT-1122] Apply zizmor suggestions (#1879)
fix: implement zizmor suggestions
1 parent 2412660 commit 8501e14

8 files changed

+36
-9
lines changed

.github/workflows/cherry-pick-image.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ jobs:
4848
service_account: '[email protected]'
4949
- name: "Perform cherry-pick"
5050
run: |
51-
SOURCE_IMAGE="${{ inputs.source_gcr_url }}:${{ inputs.gcr_tag }}"
52-
TARGET_IMAGE="${{ inputs.target_gcr_url }}:${{ inputs.gcr_tag }}"
53-
echo "Cherry picking ${{ inputs.gcr_tag }} from ${SOURCE_IMAGE} to ${TARGET_IMAGE}"
51+
SOURCE_IMAGE="${SOURCE_GCR_URL}:${GCR_TAG}"
52+
TARGET_IMAGE="${TARGET_GCR_URL}:${GCR_TAG}"
53+
echo "Cherry picking ${GCR_TAG} from ${SOURCE_IMAGE} to ${TARGET_IMAGE}"
5454
gcloud container images add-tag --quiet "${SOURCE_IMAGE}" "${TARGET_IMAGE}"
55+
env:
56+
SOURCE_GCR_URL: ${{ inputs.source_gcr_url }}
57+
TARGET_GCR_URL: ${{ inputs.target_gcr_url }}
58+
GCR_TAG: ${{ inputs.gcr_tag }}
5559

.github/workflows/dev-image-update.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
with:
2525
ref: develop
2626
token: ${{ secrets.BROADBOT_TOKEN }}
27+
persist-credentials: false
2728
- name: "Bump the tag to a new version"
2829
id: bumperstep
2930
uses: broadinstitute/datarepo-actions/actions/[email protected]
@@ -44,14 +45,15 @@ jobs:
4445
uses: actions/checkout@v3
4546
with:
4647
ref: ${{ needs.bump_version.outputs.api_image_tag }}
48+
persist-credentials: false
4749
- name: Set up JDK
4850
uses: actions/setup-java@v3
4951
with:
5052
java-version: '17'
5153
distribution: 'temurin'
5254
cache: 'gradle'
5355
- name: "Publish to Artifactory"
54-
uses: gradle/gradle-build-action@v2
56+
uses: gradle/gradle-build-action@v2.12.0
5557
with:
5658
arguments: ':datarepo-client:artifactoryPublish'
5759
env:
@@ -68,6 +70,7 @@ jobs:
6870
uses: actions/checkout@v3
6971
with:
7072
ref: ${{ needs.bump_version.outputs.api_image_tag }}
73+
persist-credentials: false
7174
- name: Set up JDK 17
7275
uses: actions/setup-java@v4
7376
with:
@@ -80,10 +83,10 @@ jobs:
8083
base64 --decode <<< ${{ secrets.SA_B64_CREDENTIALS }} > ${GOOGLE_APPLICATION_CREDENTIALS}
8184
jq -r .private_key ${GOOGLE_APPLICATION_CREDENTIALS} > ${GOOGLE_SA_CERT}
8285
chmod 644 ${GOOGLE_SA_CERT}
83-
# Set tag to semver version
84-
export GCR_TAG=${{ needs.bump_version.outputs.api_image_tag }}
8586
# Build, tag and push the image
8687
./gradlew jib
88+
env:
89+
GCR_TAG: ${{ needs.bump_version.outputs.api_image_tag }}
8790

8891
cherry_pick_image_to_production_gcr:
8992
needs: [bump_version, build_container_and_publish]

.github/workflows/helmtagbumper.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
with:
1212
fetch-depth: 0
1313
ref: develop
14+
persist-credentials: false
1415
- name: 'Fetch latest jade-data-repo image tag'
1516
id: apiprevioustag
1617
run: |
@@ -22,6 +23,7 @@ jobs:
2223
repository: 'broadinstitute/datarepo-helm'
2324
path: datarepo-helm
2425
token: "${{ secrets.BROADBOT_TOKEN }}"
26+
persist-credentials: false
2527
- name: "[datarepo-helm] [value.yaml] Update image tag"
2628
uses: docker://mikefarah/yq:3
2729
with:

.github/workflows/int-and-connected-test-run.yml

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
21+
persist-credentials: false
2122
- name: Set up JDK 17
2223
uses: actions/setup-java@v4
2324
with:
@@ -44,6 +45,8 @@ jobs:
4445
steps:
4546
- name: Checkout code
4647
uses: actions/checkout@v4
48+
with:
49+
persist-credentials: false
4750
- name: Set up JDK 17
4851
uses: actions/setup-java@v4
4952
with:
@@ -89,6 +92,8 @@ jobs:
8992
steps:
9093
- name: Checkout code
9194
uses: actions/checkout@v4
95+
with:
96+
persist-credentials: false
9297
- name: Set up JDK 17
9398
uses: actions/setup-java@v4
9499
with:
@@ -148,6 +153,8 @@ jobs:
148153
steps:
149154
- name: Checkout code
150155
uses: actions/checkout@v4
156+
with:
157+
persist-credentials: false
151158
- name: Get the latest git hash
152159
id: config
153160
run: |

.github/workflows/release-python-client.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
id-token: write
2525
steps:
2626
- uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
2729
- name: Set up Python 3.7
2830
uses: actions/setup-python@v4
2931
with:

.github/workflows/staging-smoke-tests.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
uses: actions/checkout@v3
2929
with:
3030
fetch-depth: 0
31+
persist-credentials: false
3132
- name: "Setup Java 17"
3233
uses: actions/setup-java@v3
3334
with:
@@ -43,8 +44,11 @@ jobs:
4344
- name: "Checkout tag for DataBiosphere/jade-data-repo"
4445
if: github.ref == 'refs/heads/develop'
4546
run: |
46-
git checkout ${{ steps.configuration.outputs.staging_version }}
47-
echo "Current branch is ${{ github.ref }}"
47+
git checkout "${STAGING_VERSION}"
48+
echo "Current branch is ${GITHUB_REF}"
49+
env:
50+
STAGING_VERSION: ${{ steps.configuration.outputs.staging_version }}
51+
GITHUB_REF: ${{ github.ref }}
4852
- name: "Perform IAM policy cleanup for staging"
4953
run: |
5054
# write token

.github/workflows/tag.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
with:
5151
ref: ${{ inputs.ref }}
5252
token: ${{ secrets.BROADBOT_TOKEN }} # this allows the push to succeed later
53+
persist-credentials: false
5354
- name: Bump the tag to a new version
5455
# https://github.com/DataBiosphere/github-actions/tree/master/actions/bumper
5556
uses: databiosphere/github-actions/actions/[email protected]
@@ -66,7 +67,9 @@ jobs:
6667
- name: Echo tag to console
6768
if: ${{ inputs.print-tag == 'true' }}
6869
run: |
69-
echo "Newly created version tag: '${{ steps.tag.outputs.new_tag }}'"
70+
echo "Newly created version tag: '${NEW_TAG}'"
7071
echo "build.gradle"
7172
echo "==============="
7273
cat build.gradle
74+
env:
75+
NEW_TAG: ${{ steps.tag.outputs.new_tag }}

.github/workflows/trivy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- name: Check out the code
1313
uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
1416
- name: Set up JDK 17 and cache Gradle build
1517
uses: actions/setup-java@v4
1618
with:

0 commit comments

Comments
 (0)