From 7f9e6dad38365201590645da07fa4cfd824abb29 Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Mon, 3 Apr 2023 16:54:29 +0100 Subject: [PATCH] Allow overriding target branch in on-demand nightly image builds Signed-off-by: Neil Twigg --- .github/workflows/nightly.yaml | 12 ++++++++---- .github/workflows/rc_nightly.yaml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 19dbd47523..61433fe258 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,11 +1,15 @@ name: "NATS Server Nightly: DEV" on: - workflow_dispatch: {} + workflow_dispatch: + inputs: + target: + description: "Override image branch (optional)" + type: string + required: false schedule: - cron: "40 4 * * *" - jobs: nightly_release: runs-on: ubuntu-latest @@ -14,7 +18,7 @@ jobs: uses: actions/checkout@v3 with: path: src/github.com/nats-io/nats-server - ref: dev + ref: ${{ inputs.target || 'dev' }} - uses: ./src/github.com/nats-io/nats-server/.github/actions/nightly-release with: @@ -22,4 +26,4 @@ jobs: workdir: src/github.com/nats-io/nats-server label: nightly hub_username: "${{ secrets.DOCKER_USERNAME }}" - hub_password: "${{ secrets.DOCKER_PASSWORD }}" \ No newline at end of file + hub_password: "${{ secrets.DOCKER_PASSWORD }}" diff --git a/.github/workflows/rc_nightly.yaml b/.github/workflows/rc_nightly.yaml index 9dc68f7dfa..2228e226b2 100644 --- a/.github/workflows/rc_nightly.yaml +++ b/.github/workflows/rc_nightly.yaml @@ -1,11 +1,15 @@ name: "NATS Server Nightly: MAIN" on: - workflow_dispatch: {} + workflow_dispatch: + inputs: + target: + description: "Override image branch (optional)" + type: string + required: false schedule: - cron: "40 4 * * *" - jobs: nightly_main_release: runs-on: ubuntu-latest @@ -14,7 +18,7 @@ jobs: uses: actions/checkout@v3 with: path: src/github.com/nats-io/nats-server - ref: main + ref: ${{ inputs.target || 'main' }} - uses: ./src/github.com/nats-io/nats-server/.github/actions/nightly-release with: @@ -22,4 +26,4 @@ jobs: workdir: src/github.com/nats-io/nats-server label: nightly-main hub_username: "${{ secrets.DOCKER_USERNAME }}" - hub_password: "${{ secrets.DOCKER_PASSWORD }}" \ No newline at end of file + hub_password: "${{ secrets.DOCKER_PASSWORD }}"