diff --git a/.github/workflows/kata-deploy-test.yaml b/.github/workflows/kata-deploy-test.yaml index c2270ebd05..e7ff49e1a5 100644 --- a/.github/workflows/kata-deploy-test.yaml +++ b/.github/workflows/kata-deploy-test.yaml @@ -1,11 +1,19 @@ on: - workflow_dispatch: # this is used to trigger the workflow on non-main branches + pull_request: # this will trigger the workflow on PRs that changes release version + types: + - opened + - edited + - reopened + - synchronize + paths: + - VERSION + workflow_dispatch: # this allows to trigger the workflow manually on non-main branches inputs: pr: description: 'PR number from the selected branch to test' type: string required: true - issue_comment: + issue_comment: # this allows to trigger the workflow from main by commenting "/test_kata_deploy" types: [created, edited] name: test-kata-deploy @@ -19,13 +27,14 @@ jobs: && github.event.action == 'created' && startsWith(github.event.comment.body, '/test_kata_deploy') || github.event_name == 'workflow_dispatch' + || github.event_name == 'pull_request' steps: - name: Check membership on comment or dispatch uses: kata-containers/is-organization-member@1.0.1 id: is_organization_member with: organization: kata-containers - username: ${{ github.event.comment.user.login || github.event.sender.login }} + username: ${{ github.event.comment.user.login || github.event.sender.login }} # first one applies only on issue_comment token: ${{ secrets.GITHUB_TOKEN }} - name: Fail if not member run: | @@ -61,8 +70,10 @@ jobs: run: | if [ ${{ github.event_name }} == 'issue_comment' ]; then ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#') - else # workflow_dispatch + elif [ ${{ github.event_name }} == 'workflow_dispatch' ]; then ref="refs/pull/${{ github.event.inputs.pr }}/merge" + elif [ ${{ github.event_name }} == 'pull_request' ]; then + ref="refs/pull/${{ github.event.number }}/merge" fi echo "reference for PR: " ${ref} "event:" ${{ github.event_name }} echo "##[set-output name=pr-ref;]${ref}" @@ -101,8 +112,10 @@ jobs: run: | if [ ${{ github.event_name }} == 'issue_comment' ]; then ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#') - else # workflow_dispatch + elif [ ${{ github.event_name }} == 'workflow_dispatch' ]; then ref="refs/pull/${{ github.event.inputs.pr }}/merge" + elif [ ${{ github.event_name }} == 'pull_request' ]; then + ref="refs/pull/${{ github.event.number }}/merge" fi echo "reference for PR: " ${ref} "event:" ${{ github.event_name }} echo "##[set-output name=pr-ref;]${ref}" @@ -132,8 +145,10 @@ jobs: run: | if [ ${{ github.event_name }} == 'issue_comment' ]; then ref=$(cat $GITHUB_EVENT_PATH | jq -r '.issue.pull_request.url' | sed 's#^.*\/pulls#refs\/pull#' | sed 's#$#\/merge#') - else # workflow_dispatch + elif [ ${{ github.event_name }} == 'workflow_dispatch' ]; then ref="refs/pull/${{ github.event.inputs.pr }}/merge" + elif [ ${{ github.event_name }} == 'pull_request' ]; then + ref="refs/pull/${{ github.event.number }}/merge" fi echo "reference for PR: " ${ref} "event:" ${{ github.event_name }} echo "##[set-output name=pr-ref;]${ref}" diff --git a/docs/Release-Process.md b/docs/Release-Process.md index 7dcfb84a30..c9991d4b09 100644 --- a/docs/Release-Process.md +++ b/docs/Release-Process.md @@ -48,7 +48,7 @@ ### Merge all bump version Pull requests - The above step will create a GitHub pull request in the Kata projects. Trigger the CI using `/test` command on each bump Pull request. - - Trigger the `test-kata-deploy` workflow which is under the `Actions` tab on the repository GitHub page (make sure to select the correct branch and validate it passes). + - `test-kata-deploy` workflow should be triggered automatically, validate it passes under the `Actions` tab on the repository GitHub page (you're also able to run it manually from there). - Check any failures and fix if needed. - Work with the Kata approvers to verify that the CI works and the pull requests are merged.