fix: update test to include push event (#1173)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@@ -26,7 +26,6 @@ jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'push'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
@@ -50,6 +49,7 @@ jobs:
|
||||
|
||||
- name: Run eslint on changed files
|
||||
uses: tj-actions/eslint-changed-files@v18
|
||||
if: github.event_name != 'push'
|
||||
with:
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
config_path: ".eslintrc.json"
|
||||
@@ -62,13 +62,14 @@ jobs:
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v14
|
||||
id: changed_files
|
||||
if: github.event_name != 'push'
|
||||
with:
|
||||
files: |
|
||||
src
|
||||
dist
|
||||
|
||||
- name: Commit files
|
||||
if: steps.changed_files.outputs.files_changed == 'true'
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name != 'push'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
@@ -76,7 +77,7 @@ jobs:
|
||||
git commit -m "Added missing changes and modified dist assets."
|
||||
|
||||
- name: Push changes
|
||||
if: steps.changed_files.outputs.files_changed == 'true'
|
||||
if: steps.changed_files.outputs.files_changed == 'true' && github.event_name == 'pull_request'
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.PAT_TOKEN }}
|
||||
@@ -1160,7 +1161,7 @@ jobs:
|
||||
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }}
|
||||
workflow-id: 'test.yml'
|
||||
- name: Run changed-files with a custom base sha
|
||||
if: github.event_name == 'pull_request' && github.event.action != 'closed' && matrix.fetch-depth == 0
|
||||
if: github.event_name != 'push' && github.event.action != 'closed' && matrix.fetch-depth == 0
|
||||
id: changed-files-custom-base-sha
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user