ci(): added trufflehog, release notification improvements

This commit is contained in:
ITQ
2026-05-03 12:55:07 +03:00
parent 1e2625a460
commit 517de4d372
+37 -10
View File
@@ -13,15 +13,30 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build: trufflehog:
name: Build & Test name: TruffleHog Secret Scan
uses: ./.github/workflows/build.yaml runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run TruffleHog
uses: trufflesecurity/trufflehog@main
with:
extra_args: --results=verified,unknown
build:
name: Build & Test
needs: [trufflehog]
uses: ./.github/workflows/build.yaml
docker: docker:
name: Docker name: Docker
needs: build needs: build
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
uses: ./.github/workflows/docker.yaml uses: ./.github/workflows/docker.yaml
permissions: permissions:
contents: read contents: read
@@ -30,10 +45,10 @@ jobs:
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
secrets: inherit secrets: inherit
telegram-notify: notify-main:
name: Send Telegram Notification name: Notify Main Build
needs: docker needs: docker
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
@@ -42,13 +57,13 @@ jobs:
env: env:
TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
VERSION: ${{ github.ref_name }}
REPO: ${{ github.repository }} REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
DIGEST: ${{ needs.docker.outputs.image-digest }} DIGEST: ${{ needs.docker.outputs.image-digest }}
run: | run: |
RELEASE_URL="https://github.com/${REPO}/releases/tag/${VERSION}" COMMIT_URL="https://github.com/${REPO}/commit/${SHA}"
MSG="*${REPO}* - released *${VERSION}*" MSG="*${REPO}* - main branch CI succeeded"
MSG="${MSG}%0A🔗 [Release notes](${RELEASE_URL})" MSG="${MSG}%0A🔗 [Commit](${COMMIT_URL})"
if [ -n "${DIGEST}" ]; then if [ -n "${DIGEST}" ]; then
MSG="${MSG}%0AImage: \`ghcr.io/${REPO}@${DIGEST}\`" MSG="${MSG}%0AImage: \`ghcr.io/${REPO}@${DIGEST}\`"
fi fi
@@ -57,3 +72,15 @@ jobs:
-d "chat_id=${CHAT_ID}" \ -d "chat_id=${CHAT_ID}" \
-d "parse_mode=Markdown" \ -d "parse_mode=Markdown" \
-d "text=${MSG}" -d "text=${MSG}"
release:
name: Release
needs: docker
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
uses: ./.github/workflows/release.yaml
with:
version: ${{ github.ref_name }}
image-digest: ${{ needs.docker.outputs.image-digest }}
secrets: inherit