Skip to content

Commit

Permalink
chore: address actions linting
Browse files Browse the repository at this point in the history
Signed-off-by: James Petersen <[email protected]>
  • Loading branch information
found-it committed Dec 13, 2024
1 parent 31954c7 commit f297dab
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 13 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: GitHub Actions Security Analysis

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

jobs:
zizmor:
name: zizmor latest via PyPI
runs-on: ubuntu-latest
permissions:
security-events: write
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4

Check warning

Code scanning / zizmor

unpinned-uses Warning

unpinned-uses
with:
persist-credentials: false

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4

Check warning

Code scanning / zizmor

unpinned-uses Warning

unpinned-uses

- name: Run zizmor
run: uvx zizmor --pedantic --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3

Check warning

Code scanning / zizmor

unpinned-uses Warning

unpinned-uses
with:
sarif_file: results.sarif
category: zizmor
11 changes: 6 additions & 5 deletions .github/workflows/ci-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Helm
uses: azure/[email protected]
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: v3.14.4

- uses: actions/setup-python@v5
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: '3.x'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down Expand Up @@ -59,7 +60,7 @@ jobs:
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0

- name: Prepare cluster for tests
if: steps.list-changed.outputs.changed == 'true'
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
egress-policy: audit

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
submodules: recursive
persist-credentials: false
Expand All @@ -120,6 +120,8 @@ jobs:
echo "short_sha=$(git rev-parse --short ${GITHUB_REF})" >> $GITHUB_OUTPUT
echo "INFO: Normalizing repository name (lowercase)"
echo "repository_owner=$(echo ${GITHUB_REPOSITORY_OWNER} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
PROTECT_WEBHOOK_CHART_VERSION_TAG=$(cat charts/protect-webhook/Chart.yaml | grep version: | cut -d " " -f 2)
echo "protect_webhook_chart_version_tag=${PROTECT_WEBHOOK_CHART_VERSION_TAG}" >> $GITHUB_OUTPUT
env:
GITHUB_REF: '${{ github.ref }}'
GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
Expand All @@ -130,19 +132,22 @@ jobs:
- name: Publish new helm chart for protect-webhook
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${GITHUB_ACTOR} --password-stdin
PROTECT_WEBHOOK_CHART_VERSION_TAG=$(cat charts/protect-webhook/Chart.yaml | grep version: | cut -d " " -f 2)
echo "PROTECT_WEBHOOK_CHART_VERSION_TAG=${PROTECT_WEBHOOK_CHART_VERSION_TAG}" >> $GITHUB_ENV
helm package charts/protect-webhook/ --version="${PROTECT_WEBHOOK_CHART_VERSION_TAG}"
helm push protect-webhook-"${PROTECT_WEBHOOK_CHART_VERSION_TAG}".tgz oci://ghcr.io/${{ steps.resolve_parameters.outputs.repository_owner }}/charts
helm push protect-webhook-"${PROTECT_WEBHOOK_CHART_VERSION_TAG}".tgz oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts
env:
GITHUB_ACTOR: '${{ github.actor }}'
GITHUB_REPOSITORY_OWNER: '${{ github.repository_owner }}'
GITHUB_REPOSITORY_OWNER: '${{ steps.resolve_parameters.outputs.repository_owner }}'
PROTECT_WEBHOOK_CHART_VERSION_TAG: '${{ steps.resolve_parameters.outputs.protect_webhook_chart_version_tag }}'

- name: Job summary
run: |
echo "New helm chart for protect-webhook published successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Parameters:**" >> $GITHUB_STEP_SUMMARY
echo "- Ref: ${{ steps.resolve_parameters.outputs.resolved_ref }}" >> $GITHUB_STEP_SUMMARY
echo "- Short SHA: ${{ steps.resolve_parameters.outputs.short_sha }}" >> $GITHUB_STEP_SUMMARY
echo "- protect-webhook Chart version: ${{ env.PROTECT_WEBHOOK_CHART_VERSION_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "- Ref: ${RESOLVED_REF}" >> $GITHUB_STEP_SUMMARY
echo "- Short SHA: ${SHORT_SHA}" >> $GITHUB_STEP_SUMMARY
echo "- protect-webhook Chart version: ${PROTECT_WEBHOOK_CHART_VERSION_TAG}" >> $GITHUB_STEP_SUMMARY
env:
RESOLVED_REF: '${{ steps.resolve_parameters.outputs.resolved_ref }}'
SHORT_SHA: '${{ steps.resolve_parameters.outputs.short_sha }}'
PROTECT_WEBHOOK_CHART_VERSION_TAG: '${{ steps.resolve_parameters.outputs.protect_webhook_chart_version_tag }}'

0 comments on commit f297dab

Please sign in to comment.