Skip to content

Commit

Permalink
Only run npm run all on Dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrohdezma committed Mar 1, 2023
1 parent ae5d03b commit 779c041
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@ jobs:
run: npm run all

- name: Save PR number
if: github.actor != 'dependabot[bot]'
run: echo ${{ github.event.number }} > PR_NUMBER

- name: Upload artifact with `PR_NUMBER`
if: github.actor != 'dependabot[bot]'
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: PR_NUMBER
path: PR_NUMBER

- name: Upload artifact with `dist` folder
if: github.actor != 'dependabot[bot]'
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: dist
path: dist/

- name: Upload artifact with `covertura.xml`
if: github.actor != 'dependabot[bot]'
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: cobertura
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/code_coverage_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: Add comment with code-coverage to PR

on:
workflow_run:
workflows: ["CI"]
workflows: ['CI']
types:
- completed

jobs:
add-comment-with-code-coverage:
runs-on: ubuntu-latest
if: >
github.actor != 'dependabot[bot]' &&
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
badge: true
format: markdown
output: both
thresholds: "60 80"
thresholds: '60 80'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd # v2.5.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_pr_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
release-snapshot-artifact:
runs-on: ubuntu-latest
if: >
github.actor != 'dependabot[bot]' &&
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remove_snapshot_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
delete-pr-branch:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target'
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout project
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
Expand Down

0 comments on commit 779c041

Please sign in to comment.