From c8632525df0a42dc3f24100c25467777edaaa6a6 Mon Sep 17 00:00:00 2001 From: Nikita Korolev Date: Mon, 4 Mar 2024 23:57:29 +0300 Subject: [PATCH] chore(cicd): add input tag for manual build on self-hosted runner Signed-off-by: Nikita Korolev --- .github/workflows/build_dev_man.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_dev_man.yml b/.github/workflows/build_dev_man.yml index 7e0d22120..a2f271f6f 100644 --- a/.github/workflows/build_dev_man.yml +++ b/.github/workflows/build_dev_man.yml @@ -2,7 +2,8 @@ name: Build and push for dev (Manually) env: MODULES_REGISTRY: ${{ vars.DEV_REGISTRY }} - CI_COMMIT_REF_NAME: ${{ github.ref_name }} + CI_COMMIT_REF_NAME: ${{ github.event.inputs.tag }} +# CI_COMMIT_REF_NAME: ${{ github.ref_name }} MODULES_MODULE_NAME: ${{ vars.MODULE_NAME }} MODULES_MODULE_SOURCE: ${{ vars.DEV_MODULE_SOURCE }} MODULES_REGISTRY_LOGIN: ${{ vars.DEV_MODULES_REGISTRY_LOGIN }} @@ -10,19 +11,35 @@ env: on: workflow_dispatch: + inputs: + + tag: + description: "The module's tag, which must pr654 For example: pr56" + type: string + required: true # pull_request: # types: [ opened, edited, synchronize ] # push: # branches: # - main concurrency: - group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + group: ${{ github.workflow }}-${{ github.event.number || github.event.inputs.tag }} cancel-in-progress: true jobs: + tag_validation: + runs-on: [self-hosted, test-vm-runner] + steps: + - name: Validation for tag + run: | + echo ${{ github.event.inputs.tag }} | grep -P '^pr\d+$' + shell: bash + show_dev_manifest: runs-on: [self-hosted, test-vm-runner] name: Show + needs: + - tag_validation steps: - name: Set vars for PR if: ${{ github.ref_name != 'main' }} @@ -82,6 +99,8 @@ jobs: lint: runs-on: [self-hosted, test-vm-runner] name: Run linter + needs: + - tag_validation steps: - name: Set up Go 1.20 uses: actions/setup-go@v5 @@ -129,6 +148,7 @@ jobs: runs-on: [self-hosted, test-vm-runner] name: Build and Push images needs: + - tag_validation - lint - test steps: