From 914d919c60378f118c1dca7a0c5fec6f39bc61e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Ara=C3=BAjo=20Gomes?= Date: Fri, 25 Oct 2024 16:17:58 +0100 Subject: [PATCH] remove unused gh actions --- .github/workflows/release-apispec.yml | 196 ------------------ .../workflows/release-dkr-image-for-tag.yml | 112 ---------- 2 files changed, 308 deletions(-) delete mode 100644 .github/workflows/release-apispec.yml delete mode 100644 .github/workflows/release-dkr-image-for-tag.yml diff --git a/.github/workflows/release-apispec.yml b/.github/workflows/release-apispec.yml deleted file mode 100644 index d41daa8d666..00000000000 --- a/.github/workflows/release-apispec.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: goreleaser-apispec - -on: - workflow_dispatch: - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 - - name: Set short hash - id: shorthash - run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" - - uses: toko-bifrost/ms-teams-deploy-card@dcc94e4ce4088b1e6b6de5c9a3cda4ddcbe97d2e # 3.1.2 - if: always() - with: - github-token: ${{ secrets.KICS_BOT_PAT }} - webhook-uri: ${{ secrets.MSTEAMS_WEBHOOK_URL }} - card-layout-start: cozy - card-layout-exit: complete - show-on-start: true - show-on-exit: true - custom-facts: | - - name: APISpec Release Commit - value: ${{ steps.shorthash.outputs.sha8 }} - custom-actions: | - - name: View CI Logs - value: https://github.com/Checkmarx/kics/actions/runs/${{ github.run_id }}" - - name: View HEAD Commit - value: https://github.com/Checkmarx/kics/commit/${{ github.sha }} - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.23.x - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 #v5.1.0 - with: - version: v0.160.0 - args: release --rm-dist --snapshot --skip-validate --config="./release/.goreleaser-apispec.yml" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - DESCRIPTIONS_URL: ${{ secrets.DESCRIPTIONS_URL }} - APISCANNER: "true" - - name: delete release - uses: dev-drprasad/delete-tag-and-release@82600feb9527126eca69833f07bafe53279bd9b4 # v1.1 - with: - delete_release: true # default: false - tag_name: apispec # tag name to delete - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create Release - id: create_release - uses: actions/create-release@v1.1.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: apispec - release_name: apispec-${{ steps.shorthash.outputs.sha8 }} - draft: false - prerelease: true - - name: Display assets - run: | - ls -l /home/runner/work/kics/kics/dist - - name: Upload Release Asset Linux - id: upload-release-asset-linux - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: /home/runner/work/kics/kics/dist/kics_apispec_linux_x64.tar.gz - asset_name: kics_apispec-release_linux_amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Darwin - id: upload-release-asset-darwin - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: /home/runner/work/kics/kics/dist/kics_apispec_darwin_x64.tar.gz - asset_name: kics_apispec-release_darwin_amd64.tar.gz - asset_content_type: application/gzip - - name: Upload Release Asset Windows - id: upload-release-asset-windows - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: /home/runner/work/kics/kics/dist/kics_apispec_windows_x64.zip - asset_name: kics_apispec-release_windows_amd64.zip - asset_content_type: application/zip - - name: Upload Release Asset Checksum - id: upload-release-asset-checksums - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: /home/runner/work/kics/kics/dist/kics_apispec_checksums.txt - asset_name: kics_apispec-release_checksums.txt - asset_content_type: text/plain - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: toko-bifrost/ms-teams-deploy-card@dcc94e4ce4088b1e6b6de5c9a3cda4ddcbe97d2e # 3.1.2 - if: always() - with: - github-token: ${{ secrets.KICS_BOT_PAT }} - webhook-uri: ${{ secrets.MSTEAMS_WEBHOOK_URL }} - card-layout-start: cozy - card-layout-exit: complete - show-on-start: true - show-on-exit: true - custom-facts: | - - name: APISpec Release Commit - value: ${{ steps.shorthash.outputs.sha8 }} - custom-actions: | - - name: View CI Logs - value: https://github.com/Checkmarx/kics/actions/runs/${{ github.run_id }}" - - name: View HEAD Commit - value: https://github.com/Checkmarx/kics/commit/${{ github.sha }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0 - - name: Login to DockerHub - uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Push alpine to Docker Hub - id: build_alpine - uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # v6.4.1 - with: - context: . - push: true - file: ./docker/Dockerfile.apispec - tags: checkmarx/kics:apispec,checkmarx/kics:apispec-alpine - build-args: | - VERSION=apipsec-${{ steps.shorthash.outputs.sha8 }} - COMMIT=${{ github.sha }} - DESCRIPTIONS_URL=${{ secrets.DESCRIPTIONS_URL }} - APISCANNER="true" - - name: Build and push debian to Docker Hub - id: build_debian - uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # v6.4.1 - with: - context: . - file: ./docker/Dockerfile.apispec.debian - push: true - tags: checkmarx/kics:apispec-debian,checkmarx/kics:apispec-debian-latest - build-args: | - VERSION=apipsec-${{ steps.shorthash.outputs.sha8 }} - COMMIT=${{ github.sha }} - DESCRIPTIONS_URL=${{ secrets.DESCRIPTIONS_URL }} - APISCANNER="true" - - name: Export Image Digests - run: | - VERSION=apispec - - COMMIT_SHA8=${{ steps.shorthash.outputs.sha8 }} - DATE=$(date +'%Y-%m-%d') - DIGEST=${{ steps.build_alpine.outputs.digest }} - ALPINE_DIGEST=${{ steps.build_alpine.outputs.digest }} - DEBIAN_DIGEST=${{ steps.build_debian.outputs.digest }} - - echo "scratch,${COMMIT_SHA8},${DATE},${DIGEST}" >> docs/docker/apispec.csv - echo "alpine,${COMMIT_SHA8},${DATE},${ALPINE_DIGEST}" >> docs/docker/apispec.csv - echo "debian,${COMMIT_SHA8},${DATE},${DEBIAN_DIGEST}" >> docs/docker/apispec.csv - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - name: Generate .md table - run: | - pip install csvtomd - csvtomd docs/docker/apispec.csv > docs/docker/apispec.md - - name: Create Pull Request - uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6 - with: - title: "docs(kicsbot): update images digest" - token: ${{ secrets.KICS_BOT_PAT }} - commit-message: "docs(kicsbot): update images digest" - delete-branch: true - branch: feature/kicsbot-update-queries-docs - body: | - **Automated Changes** - Updating docker images digests - Triggered by SHA: _${{ github.sha }}_ - labels: documentation diff --git a/.github/workflows/release-dkr-image-for-tag.yml b/.github/workflows/release-dkr-image-for-tag.yml deleted file mode 100644 index f1d37aeabff..00000000000 --- a/.github/workflows/release-dkr-image-for-tag.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: release-manual-docker-tag-latest - -on: - workflow_dispatch: - inputs: - tag: - description: "Git Tag" - required: true - latest: - description: "true if image is latest" - default: "false" - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - env: - DOCKER_CLI_EXPERIMENTAL: "enabled" - steps: - - name: Check out the repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: ${{ github.event.inputs.tag }} - - uses: toko-bifrost/ms-teams-deploy-card@dcc94e4ce4088b1e6b6de5c9a3cda4ddcbe97d2e # 3.1.2 - if: always() - with: - github-token: ${{ secrets.KICS_BOT_PAT }} - webhook-uri: ${{ secrets.MSTEAMS_WEBHOOK_URL }} - card-layout-start: cozy - card-layout-exit: complete - show-on-start: true - show-on-exit: true - custom-actions: | - - name: View CI Logs - value: https://github.com/Checkmarx/kics/actions/runs/${{ github.run_id }} - - name: View HEAD Commit - value: https://github.com/Checkmarx/kics/commit/${{ github.sha }} - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=Checkmarx/kics - VERSION=${{ github.event.inputs.tag }} - TAGS="${DOCKER_IMAGE}:${VERSION}" - ALPINE_TAGS="${TAGS}-alpine" - DEBIAN_TAGS="${TAGS}-debian" - UBI8_TAGS="${TAGS}-ubi8" - - if [ "${{ github.event.inputs.latest }}" = "true" ]; then - TAGS=${TAGS},${DOCKER_IMAGE}:latest - ALPINE_TAGS="{ALPINE_TAGS},${DOCKER_IMAGE}:alpine" - DEBIAN_TAGS="{DEBIAN_TAGS},${DOCKER_IMAGE}:debian" - UBI8_TAGS="{UBI8_TAGS},${DOCKER_IMAGE}:ubi8" - fi - - echo ::set-output name=tags::${TAGS} - echo ::set-output name=alpine_tags::${ALPINE_TAGS} - echo ::set-output name=debian_tags::${DEBIAN_TAGS} - echo ::set-output name=ubi8_tags::${UBI8_TAGS} - - name: Set up QEMU - uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v2 - with: - image: tonistiigi/binfmt:latest - platforms: linux/amd64,linux/arm64 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0 - - name: Login to DockerHub - uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Push alpine to Docker Hub - uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # v6.4.1 - with: - context: . - push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.prep.outputs.tags }},${{ steps.prep.outputs.alpine_tags }} - build-args: | - VERSION=${{ github.event.inputs.tag }} - COMMIT=${{ github.sha }} - SENTRY_DSN=${{ secrets.SENTRY_DSN }} - DESCRIPTIONS_URL=${{ secrets.DESCRIPTIONS_URL }} - - name: Push debian to Docker Hub - if: ${{ hashFiles('./docker/Dockerfile.debian') }} != "" - id: build_debian - uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # v6.4.1 - with: - context: . - file: ./docker/Dockerfile.debian - push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.prep.outputs.debian_tags }} - build-args: | - VERSION=${{ github.event.inputs.tag }} - COMMIT=${{ github.sha }} - SENTRY_DSN=${{ secrets.SENTRY_DSN }} - DESCRIPTIONS_URL=${{ secrets.DESCRIPTIONS_URL }} - - name: Push ubi8 to Docker Hub - if: ${{ hashFiles('./docker/Dockerfile.ubi8') }} != "" - id: build_ubi8 - uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # v6.4.1 - with: - context: . - file: ./docker/Dockerfile.ubi8 - push: true - platforms: linux/amd64 - tags: ${{ steps.prep.outputs.ubi8_tags }} - build-args: | - VERSION=${{ github.event.inputs.tag }} - COMMIT=${{ github.sha }} - SENTRY_DSN=${{ secrets.SENTRY_DSN }} - DESCRIPTIONS_URL=${{ secrets.DESCRIPTIONS_URL }}