From f228d477ef74841c262969ee53dd82c2b5d449ae Mon Sep 17 00:00:00 2001 From: Diogo Goncalves Date: Thu, 21 Nov 2024 18:56:59 +0000 Subject: [PATCH] fix: workflow to run on dispatch --- .github/workflows/upload-pypi-core.yml | 13 +++++++++++++ .github/workflows/upload-pypi-proxy.yml | 12 ++++++++++++ .github/workflows/upload-pypi-sdk.yml | 12 ++++++++++++ .github/workflows/upload-pypi-tracker.yml | 12 ++++++++++++ 4 files changed, 49 insertions(+) diff --git a/.github/workflows/upload-pypi-core.yml b/.github/workflows/upload-pypi-core.yml index ab460ba0..f7af9b4c 100644 --- a/.github/workflows/upload-pypi-core.yml +++ b/.github/workflows/upload-pypi-core.yml @@ -6,11 +6,24 @@ on: - main paths: - "libs/core/**" + workflow_dispatch: + inputs: + security-token: + description: 'Security token to trigger this workflow' + required: true + type: string jobs: deploy: runs-on: ubuntu-latest steps: + - name: Check security token + run: | + if [[ "${{ github.event.inputs.security-token }}" != "${{ secrets.SECURITY_TOKEN }}" ]]; then + echo "Unauthorized access attempt detected." + exit 1 + fi + # Checkout the code - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/upload-pypi-proxy.yml b/.github/workflows/upload-pypi-proxy.yml index 35b52fa8..424c5ef2 100644 --- a/.github/workflows/upload-pypi-proxy.yml +++ b/.github/workflows/upload-pypi-proxy.yml @@ -6,11 +6,23 @@ on: - main paths: - "libs/proxy/**" + workflow_dispatch: + inputs: + security-token: + description: 'Security token to trigger this workflow' + required: true + type: string jobs: deploy: runs-on: ubuntu-latest steps: + - name: Check security token + run: | + if [[ "${{ github.event.inputs.security-token }}" != "${{ secrets.SECURITY_TOKEN }}" ]]; then + echo "Unauthorized access attempt detected." + exit 1 + fi # Checkout the code - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/upload-pypi-sdk.yml b/.github/workflows/upload-pypi-sdk.yml index 912d4b4f..0196cdc7 100644 --- a/.github/workflows/upload-pypi-sdk.yml +++ b/.github/workflows/upload-pypi-sdk.yml @@ -6,11 +6,23 @@ on: - main paths: - "libs/llmstudio/**" + workflow_dispatch: + inputs: + security-token: + description: 'Security token to trigger this workflow' + required: true + type: string jobs: deploy: runs-on: ubuntu-latest steps: + - name: Check security token + run: | + if [[ "${{ github.event.inputs.security-token }}" != "${{ secrets.SECURITY_TOKEN }}" ]]; then + echo "Unauthorized access attempt detected." + exit 1 + fi # Checkout the code - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/upload-pypi-tracker.yml b/.github/workflows/upload-pypi-tracker.yml index bce63358..d8c990a2 100644 --- a/.github/workflows/upload-pypi-tracker.yml +++ b/.github/workflows/upload-pypi-tracker.yml @@ -6,11 +6,23 @@ on: - main paths: - "libs/tracker/**" + workflow_dispatch: + inputs: + security-token: + description: 'Security token to trigger this workflow' + required: true + type: string jobs: deploy: runs-on: ubuntu-latest steps: + - name: Check security token + run: | + if [[ "${{ github.event.inputs.security-token }}" != "${{ secrets.SECURITY_TOKEN }}" ]]; then + echo "Unauthorized access attempt detected." + exit 1 + fi # Checkout the code - name: Checkout code uses: actions/checkout@v2