Skip to content

Commit 0591279

Browse files
authored
Change conditional for auto approve dependency PRs (#1233)
* Update auto_approve_dependency_PRs.yml * test * Update auto_approve_dependency_PRs.yml * add remove * fix if * fix contains * fix contains * try empty string * put back cron schedule * Update release_notes.rst * try add, test * add other conditional * try single quote * Add quotes * remove brackets and dollar sign * surround whole statement' * more surround * indent * multiline * remove extr brackets * move and * unindent * use single quote * working full conditional
1 parent a52f765 commit 0591279

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/auto_approve_dependency_PRs.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ jobs:
1010
- name: Find dependency PRs
1111
id: find_prs
1212
run: |
13-
gh pr list --repo "alteryx/woodwork" --author "machineFL" --base main --state open --search "status:success review:required" --limit 1 --json url > dep_PRs_waiting_approval.json
13+
rm -f dep_PRs_waiting_approval.json
14+
gh pr list --repo "${{ github.repository }}" --author "machineFL" --base main --state open --search "status:success review:required" --limit 1 --json url > dep_PRs_waiting_approval.json
1415
echo ::set-output name=dep_pull_request_url::$(cat dep_PRs_waiting_approval.json | grep -Eo "(https)://[a-zA-Z0-9./?=_%:-]*")
1516
env:
1617
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
1718
- name: Approve dependency PRs and enable auto-merge
18-
if: startsWith( ${{ steps.find_prs.outputs.dep_pull_request_url }}, "https://github.com/alteryx/woodwork/pull/" )
19-
run: |
20-
gh pr review --comment --body "auto approve" ${{ steps.find_prs.outputs.dep_pull_request_url }}
21-
gh pr review --approve ${{ steps.find_prs.outputs.dep_pull_request_url }}
22-
gh pr merge --auto --squash ${{ steps.find_prs.outputs.dep_pull_request_url }}
19+
id: approve_prs
20+
if: >-
21+
${{
22+
steps.find_prs.outputs.dep_pull_request_url != '' &&
23+
contains( steps.find_prs.outputs.dep_pull_request_url, 'https://github.com/alteryx/woodwork/pull/')
24+
}}
25+
run: |
26+
echo ${{ steps.find_prs.outputs.dep_pull_request_url }}
27+
gh pr review --repo "${{ github.repository }}" --comment --body "auto approve" ${{ steps.find_prs.outputs.dep_pull_request_url }}
28+
gh pr review --repo "${{ github.repository }}" --approve ${{ steps.find_prs.outputs.dep_pull_request_url }}
29+
gh pr merge --repo "${{ github.repository }}" --auto --squash ${{ steps.find_prs.outputs.dep_pull_request_url }}
2330
env:
2431
GITHUB_TOKEN: ${{ secrets.AUTO_APPROVE_TOKEN }}

docs/source/release_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Future Release
1111
* Documentation Changes
1212
* Updating contributing doc with Spark installat instructions (:pr:`1232`)
1313
* Testing Changes
14-
* Enable auto-merge for minimum and latest dependency merge requests (:pr:`1228`, :pr:`1230`)
14+
* Enable auto-merge for minimum and latest dependency merge requests (:pr:`1228`, :pr:`1230`, :pr:`1233`)
1515

1616
Thanks to the following people for contributing to this release:
1717
:user:`gsheni`, :user:`willsmithorg`

0 commit comments

Comments
 (0)