Skip to content

Commit

Permalink
fix: implement zizmor suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Jan 8, 2025
1 parent a8a9540 commit 06833ab
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Get Short Sha
id: short-sha
run: echo "sha=$(git rev-parse --short=12 HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -30,23 +32,23 @@ jobs:
- name: Construct tags
id: construct-tags
run: |
SHA_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:${{ steps.short-sha.outputs.sha }}"
SHA_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:${SHORT_SHA}"
ENVIRONMENT_TAG=""
if ${{ github.event_name == 'pull_request'}}; then
ENVIRONMENT_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:pr-${{ steps.short-sha.outputs.sha }}"
ENVIRONMENT_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:pr-${SHORT_SHA}"
elif ${{github.event_name == 'push' }}; then
ENVIRONMENT_TAG="${REGISTRY_HOST}/${GOOGLE_PROJECT}/${SERVICE_NAME}:dev"
fi
echo "sha-tag=$SHA_TAG" >> $GITHUB_OUTPUT
echo "environment-tag=$ENVIRONMENT_TAG" >> $GITHUB_OUTPUT
env:
SHORT_SHA: ${{ steps.short-sha.outputs.sha }}
- name: Build Image
run: |
docker build \
-t ${{ steps.construct-tags.outputs.sha-tag }} \
-t ${{ steps.construct-tags.outputs.environment-tag }} \
.
- name: Log Github Actor
run: echo "${{ github.actor }}"
docker build -t "${SHA_TAG}" -t "${ENVIRONMENT_TAG}" .
env:
SHA_TAG: ${{ steps.construct-tags.outputs.sha-tag }}
ENVIRONMENT_TAG: ${{ steps.construct-tags.outputs.environment-tag }}
- id: 'auth'
if: github.actor != 'dependabot[bot]'
name: 'Authenticate to Google Cloud'
Expand All @@ -59,8 +61,11 @@ jobs:
if: github.actor != 'dependabot[bot]'
run: |
gcloud auth configure-docker --quiet
docker push ${{ steps.construct-tags.outputs.sha-tag }}
docker push ${{ steps.construct-tags.outputs.environment-tag }}
docker push "${SHA_TAG}"
docker push "${ENVIRONMENT_TAG}"
env:
SHA_TAG: ${{ steps.construct-tags.outputs.sha-tag }}
ENVIRONMENT_TAG: ${{ steps.construct-tags.outputs.environment-tag }}
report-to-sherlock:
uses: broadinstitute/sherlock/.github/workflows/client-report-app-version.yaml@main
needs: [ tag-build-push ]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ jobs:
name: Check
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- run: semgrep ci --config=p/findsecbugs
11 changes: 9 additions & 2 deletions .github/workflows/smoke-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ jobs:
- name: setup
id: setup
run:
echo "bee-name=${{ github.event.repository.name }}-${{ github.run_id }}-dev" >> $GITHUB_OUTPUT
echo "bee-name=${REPO_NAME}-${RUN_ID}-dev" >> $GITHUB_OUTPUT
env:
REPO_NAME: ${{ github.event.repository.name }}
RUN_ID: ${{ github.run_id }}
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand All @@ -36,7 +41,9 @@ jobs:
inputs: '{ "bee-name": "${{ steps.setup.outputs.bee-name }}", "bee-template-name": "duos", "version-template": "dev" }'
- name: Run Smoke Tests
run: |
mvn clean test -P integration-tests -DbaseUrl=https://ontology.${{ steps.setup.outputs.bee-name }}.bee.envs-terra.bio/
mvn clean test -P integration-tests -DbaseUrl="https://ontology.${BEE_NAME}.bee.envs-terra.bio/"
env:
BEE_NAME: ${{ steps.setup.outputs.bee-name }}
- name: Store Test Result Artifact
uses: actions/upload-artifact@v4
if: always()
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: broadinstitute/dsp-appsec-trivy-action@v1

0 comments on commit 06833ab

Please sign in to comment.