Skip to content

Commit

Permalink
Merge pull request #30270 from Expensify/jpersaud_imgbot
Browse files Browse the repository at this point in the history
Add github action for imgbot review and merge
  • Loading branch information
roryabraham authored Oct 25, 2023
2 parents 8fc1de9 + 38a3f93 commit f19970f
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 10 deletions.
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
21 changes: 21 additions & 0 deletions .github/workflows/imgbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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 "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Merge imgbot PR
run: gh pr merge --auto --merge "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/preDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
newContributorWelcomeMessage:
runs-on: ubuntu-latest
needs: isExpensifyEmployee
if: ${{ github.actor != 'OSBotify' && !fromJSON(needs.isExpensifyEmployee.outputs.IS_EXPENSIFY_EMPLOYEE) }}
if: ${{ github.actor != 'OSBotify' && !fromJSON(needs.isExpensifyEmployee.outputs.IS_EXPENSIFY_EMPLOYEE) && github.actor != 'imgbot[bot]' }}
steps:
# Version: 2.3.4
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reviewerChecklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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: reviewerChecklist.js
uses: Expensify/App/.github/actions/javascript/reviewerChecklist@main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
jest:
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
env:
CI: true
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
run: npx jest --silent --shard=${{ fromJSON(matrix.chunk) }}/${{ strategy.job-total }} --max-workers ${{ steps.cpu-cores.outputs.count }}

storybookTests:
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
name: Storybook tests
steps:
Expand All @@ -51,7 +51,7 @@ jobs:
run: npm run storybook -- --smoke-test --ci

shellTests:
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
name: Shell tests
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validateDocsRoutes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
verify:
if: github.actor != 'OSBotify'
if: github.actor != 'OSBotify' && github.actor != 'imgbot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validateGithubActions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
verify:
if: github.actor != 'OSBotify'
if: github.actor != 'OSBotify' && github.actor != 'imgbot[bot]'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verifyPodfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
verify:
if: github.actor != 'OSBotify'
if: github.actor != 'OSBotify' && github.actor != 'imgbot[bot]'
runs-on: macos-latest
steps:
- name: Checkout
Expand Down

0 comments on commit f19970f

Please sign in to comment.