Skip to content

Commit

Permalink
build: Allow workflow_dispatch presubmits to checkout code and upload…
Browse files Browse the repository at this point in the history
… fixes (#1691)

Currently, there are specific checks for push and pull_request_target only.
  • Loading branch information
melink14 authored Aug 7, 2023
1 parent 7497202 commit 3f2e38b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ permissions:
jobs:
presubmit:
runs-on: ubuntu-22.04
env:
Editable: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch'

steps:
- uses: actions/[email protected]
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
- uses: actions/[email protected]
if: github.event_name == 'pull_request_target'
with:
Expand Down Expand Up @@ -51,21 +53,21 @@ jobs:
path: screenshots/Chromium/failed/
- name: Update baseline screenshots
run: npm run test:update-baselines
if: failure() && steps.check-screenshots.outputs.screenshot_failure > 0 && github.event_name == 'pull_request_target'
if: failure() && steps.check-screenshots.outputs.screenshot_failure > 0 && env.Editable
- name: Push new baselines to pull request branch
uses: EndBug/[email protected]
if: failure() && steps.check-screenshots.outputs.screenshot_failure > 0 && github.event_name == 'pull_request_target'
if: failure() && steps.check-screenshots.outputs.screenshot_failure > 0 && env.Editable
with:
message: 'test(visual): Update baselines with new screenshots'
fetch: false
add: 'screenshots/Chromium/baseline/*.png'
default_author: github_actions
- name: Try to fix lint errors
run: npm run fix
if: failure() && github.event_name == 'pull_request_target'
if: failure() && env.Editable
- name: Push lint fixes to pull request branch
uses: EndBug/[email protected]
if: failure() && github.event_name == 'pull_request_target'
if: failure() && env.Editable
with:
message: 'style: Fix lint/formatting errors'
fetch: false
Expand Down

0 comments on commit 3f2e38b

Please sign in to comment.