Skip to content

Commit

Permalink
Target main branch, ignore secret+text files in CI
Browse files Browse the repository at this point in the history
The previous settings of the "Run Tests" GitHub Actions configuration
triggered builds and test runs on _every_ push on _every_ branch. This
should limit builds only to pushes on pull requests and the `main`
branch.

Also, it turns out that GitHub Actions can ignore commits that affect
only secret files or test files. So I can make README.md changes, for
example, without kicking off an unnecessary build. Pretty cool!
  • Loading branch information
mbland committed Nov 24, 2023
1 parent 1572010 commit d694888
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Run Tests

on: [push, pull_request, workflow_dispatch]
on:
push:
branches: [ "main" ]
paths-ignore: [ ".*", "**/.*", "**.md", "**.txt" ]
pull_request:
branches: [ "main" ]
paths-ignore: [ ".*", "**/.*", "**.md", "**.txt" ]
workflow_dispatch:

jobs:
build-test:
Expand Down

0 comments on commit d694888

Please sign in to comment.