From bb772db7e4434078c2f658aa3691eeb7eef82949 Mon Sep 17 00:00:00 2001 From: Jayden Liang Date: Tue, 25 May 2021 10:02:25 -0700 Subject: [PATCH] update auto release workflow --- .github/workflows/release-on-merge-version-branch.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-on-merge-version-branch.yml b/.github/workflows/release-on-merge-version-branch.yml index af9c56c..c6cff6e 100644 --- a/.github/workflows/release-on-merge-version-branch.yml +++ b/.github/workflows/release-on-merge-version-branch.yml @@ -5,12 +5,18 @@ on: branches: - main types: [closed] + workflow_dispatch: + inputs: + pr-number: + description: >- + The pull request id that triggers the release (for manual trigger only) + required: false jobs: main_job: runs-on: ubuntu-latest name: process pull request merge event # conditionally run only when the pull request is merged. - if: github.event.pull_request.merged == true + if: github.event.pull_request.merged == true || github.event.inputs.pr-number != '' steps: # check if this pull request coming from a version-branch # if yes then proceed to create a release @@ -19,7 +25,7 @@ jobs: name: fetch versioning info uses: fortinet/github-action-version-branch@1.1.2 with: - pr-number: ${{ github.event.number }} + pr-number: ${{ github.event.number || github.event.inputs.pr-number}} github-token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token # create a release - name: 'prep: git checkout'