-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3772 from zowe/user/markackert/ci-label-behavior-…
…updates Updates to `/ci` behavior
- Loading branch information
Showing
2 changed files
with
139 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Triggers when comments are made on issues/PRs, runs when '/ci' is added to a pull request. | ||
name: Zowe CICD Issue Trigger | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
contents: write | ||
|
||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
jobs: | ||
|
||
pr-comment-check: | ||
|
||
name: 'PR Comment Check' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
issue_run_ci: ${{ steps.check-comment.outputs.issue_run_ci }} | ||
steps: | ||
- name: Check for a comment triggering a build | ||
id: check-comment | ||
run: | | ||
echo "issue_run_ci=false" >> $GITHUB_OUTPUT | ||
if [[ ! -z "${{ github.event.issue.pull_request }}" && ${{ github.event_name == 'issue_comment' }} && "${{ github.event.comment.body }}" = '/ci' ]]; then | ||
echo "issue_run_ci=true" >> $GITHUB_OUTPUT | ||
fi | ||
get-pr-branch: | ||
name: 'Get PR Branch' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
pr_branch_name: | ||
steps: | ||
- name: Find PR Branch Name | ||
run: | | ||
gh config set pager cat | ||
PR_BRANCH=$(gh pr view ${{ github.event.issue.pull_request }} -R zowe/zowe-install-packaging --json headRefName -q .headRefName) | ||
echo "pr_branch_name=$PR_BRANCH" >> $GITHUB_OUTPUT | ||
trigger-ci: | ||
name: 'Trigger Build' | ||
runs-on: ubuntu-latest | ||
needs: [pr-comment-check, get-pr-branch] | ||
if: ${{ needs.pr-comment-check.outputs.issue_run_ci == 'true' }} | ||
steps: | ||
- name: 'Trigger Build workflow' | ||
uses: zowe-actions/shared-actions/workflow-remote-call-wait@main | ||
with: | ||
github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }} | ||
owner: zowe | ||
repo: zowe-install-packaging | ||
workflow-filename: build-packaging.yml | ||
branch-name: ${{ needs.get-pr-branch.outputs.pr_branch_name }} | ||
poll-frequency: 3 | ||
inputs-json-string: '{"ORIGIN_ISSUE_TRIGGER":"true", "KEEP_TEMP_PAX_FOLDER":"false"}' | ||
env: | ||
DEBUG: zowe-actions:shared-actions:workflow-remote-call-wait |