From 102e068f022d97c455bf2c43c7251a30b25e1837 Mon Sep 17 00:00:00 2001 From: adehad <26027314+adehad@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:12:35 +0100 Subject: [PATCH 1/2] Also enable running on dispatch event --- .github/workflows/jira_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jira_ci.yml b/.github/workflows/jira_ci.yml index d0d640f4b..0eccd9f69 100644 --- a/.github/workflows/jira_ci.yml +++ b/.github/workflows/jira_ci.yml @@ -12,7 +12,7 @@ on: jobs: server: uses: ./.github/workflows/jira_server_ci.yml - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} cloud: needs: server From ea9948a8f0b95842fda34d85ac4ee847d3c0595f Mon Sep 17 00:00:00 2001 From: adehad <26027314+adehad@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:11:50 +0100 Subject: [PATCH 2/2] and with custom ref --- .github/workflows/jira_ci.yml | 10 ++++++++++ .github/workflows/jira_cloud_ci.yml | 15 ++++++++++++++- .github/workflows/jira_server_ci.yml | 16 +++++++++++++++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jira_ci.yml b/.github/workflows/jira_ci.yml index 0eccd9f69..bfd171443 100644 --- a/.github/workflows/jira_ci.yml +++ b/.github/workflows/jira_ci.yml @@ -3,6 +3,12 @@ name: ci # runs only after tox workflow finished successfully on: workflow_dispatch: + inputs: + ref: + type: string + description: 'Ref (SHA/branch) to run the workflow on' + required: true + default: 'main' workflow_run: workflows: [tox] branches: [main] @@ -13,6 +19,8 @@ jobs: server: uses: ./.github/workflows/jira_server_ci.yml if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + with: + ref: ${{ github.event.inputs.ref || 'main' }} cloud: needs: server @@ -22,6 +30,8 @@ jobs: CLOUD_ADMIN_TOKEN: ${{ secrets.CI_JIRA_CLOUD_ADMIN_TOKEN }} CLOUD_USER: ${{ secrets.CI_JIRA_CLOUD_USER }} CLOUD_USER_TOKEN: ${{ secrets.CI_JIRA_CLOUD_USER_TOKEN }} + with: + ref: ${{ github.event.inputs.ref || 'main' }} # 'check' the only job that should be marked as required in # repository config, so we do not need to change required jobs diff --git a/.github/workflows/jira_cloud_ci.yml b/.github/workflows/jira_cloud_ci.yml index 8d6aadf34..d7545cf7e 100644 --- a/.github/workflows/jira_cloud_ci.yml +++ b/.github/workflows/jira_cloud_ci.yml @@ -2,6 +2,12 @@ name: cloud on: workflow_call: + inputs: + ref: + type: string + description: 'Ref (SHA/branch) to run the workflow on' + required: true + default: 'main' secrets: CLOUD_ADMIN: required: true @@ -12,7 +18,12 @@ on: CLOUD_USER_TOKEN: required: true workflow_dispatch: - + inputs: + ref: + type: string + description: 'Ref (SHA/branch) to run the workflow on' + required: true + default: 'main' jobs: test: environment: cloud @@ -27,6 +38,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref }} - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/.github/workflows/jira_server_ci.yml b/.github/workflows/jira_server_ci.yml index 4b6c84725..355b11f42 100644 --- a/.github/workflows/jira_server_ci.yml +++ b/.github/workflows/jira_server_ci.yml @@ -2,8 +2,19 @@ name: server on: workflow_call: + inputs: + ref: + type: string + description: 'Ref (SHA/branch) to run the workflow on' + required: true + default: 'main' workflow_dispatch: - + inputs: + ref: + type: string + description: 'Ref (SHA/branch) to run the workflow on' + required: true + default: 'main' jobs: test: name: py${{ matrix.python-version }}-jira${{ matrix.jira-version }} @@ -16,6 +27,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.ref }} + - name: Start Jira docker instance run: docker run -dit -p 2990:2990 --name jira addono/jira-software-standalone --version ${{ matrix.jira-version }}