Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github action for imgbot review and merge #30270

Merged
merged 12 commits into from
Oct 25, 2023
2 changes: 1 addition & 1 deletion .github/workflows/authorChecklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
# then you also need to go into PHP and update the name of this job in the GH_JOB_NAME_CHECKLIST constant
checklist:
runs-on: ubuntu-latest
if: github.actor != 'OSBotify'
if: github.actor != 'OSBotify' && github.actor != 'imgbot[bot]'
steps:
- name: authorChecklist.js
uses: Expensify/App/.github/actions/javascript/authorChecklist@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
# This job only runs for pull request comments or pull request target events (not issue comments)
# It does not run for pull requests created by OSBotify
if: ${{ github.event.issue.pull_request || (github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'OSBotify') }}
if: ${{ github.event.issue.pull_request || (github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'OSBotify' && github.event.pull_request.user.login != 'imgbot[bot]') }}
steps:
- name: CLA comment check
uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/imgbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: imgbot Image Optimization

on: pull_request

permissions:
pull-requests: write

jobs:
approveAndMerge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'imgbot[bot]' }}
steps:
- name: Approve imgbot PR
run: gh pr review --approve "${{ env.PR_URL }}"
justinpersaud marked this conversation as resolved.
Show resolved Hide resolved
env:
PR_URL: ${{ github.event.pull_request.html_url }}
justinpersaud marked this conversation as resolved.
Show resolved Hide resolved
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge imgbot PR
run: gh pr merge --auto --merge "${{ env.PR_URL }}"
justinpersaud marked this conversation as resolved.
Show resolved Hide resolved
env:
PR_URL: ${{ github.event.pull_request.html_url }}
justinpersaud marked this conversation as resolved.
Show resolved Hide resolved
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading