Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:

env:
ACTIONS_STEP_DEBUG: '${{ secrets.ACTIONS_STEP_DEBUG }}'
GITLEAKS_VERSION: "8.30.1"

jobs:
gitleaks:
Expand All @@ -13,31 +14,13 @@ jobs:
steps:
- uses: hmarr/debug-action@v3.0.0

- name: Install
shell: bash
run: |
set -euo pipefail
arch="$(uname)_$(uname -m)"
platform=$(echo $arch | tr '[:upper:]' '[:lower:]' )
echo "PLATFORM=$platform" >> $GITHUB_ENV
echo "GITLEAKS_VERSION=$(curl -s https://api.github.com/repos/gitleaks/gitleaks/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')" >> $GITHUB_ENV

- name: Cache gitleaks archive
id: cache_gitleaks
uses: actions/cache@v5
with:
path: /usr/local/bin/gitleaks
key: gitleaks-${{ env.PLATFORM }}-${{ env.GITLEAKS_VERSION }}

- name: Download and configure gitleaks
shell: bash
run: |
set -euo pipefail
if [[ "${{ steps.cache_gitleaks.outputs.cache-hit }}" != "true" ]]; then
DOWNLOAD_URL="https://github.com/gitleaks/gitleaks/releases/download/v${{ env.GITLEAKS_VERSION }}/gitleaks_${{ env.GITLEAKS_VERSION }}_linux_x64.tar.gz"
echo "Download Gitleaks ${{ env.GITLEAKS_VERSION }} for ${{ env.PLATFORM }} from ${DOWNLOAD_URL}"
curl -fsSL "$DOWNLOAD_URL" | tar xzf - -C /usr/local/bin
fi
DOWNLOAD_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
echo "Download Gitleaks ${GITLEAKS_VERSION} from ${DOWNLOAD_URL}"
curl -fsSL "$DOWNLOAD_URL" | tar xzf - -C /usr/local/bin
chmod +x /usr/local/bin/gitleaks

- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ include:
platforms: "linux/amd64,linux/arm64"
proxy: http://172.21.1.212:7897
no_proxy: "localhost,127.0.0.1,docker,${CI_REGISTRY},${CI_SERVER_HOST},registry.opencsg.com"
build_args:
- "APT_MIRROR=https://mirrors.aliyun.com"
- "PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/"
- "PIP_TRUSTED_HOST=mirrors.aliyun.com"
Loading