Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commit 5f27a2d

Browse files
Merge pull request #2 from suzuki-shunsuke/docs/add-status-badges
fix: skip the build job when no service is changed
2 parents 7e993ff + 0c5198c commit 5f27a2d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
build:
2929
runs-on: ubuntu-latest
3030
needs: setup
31+
# if services is empty, the build job is skipped
32+
if: "join(fromJSON(needs.setup.outputs.services), '') != ''"
3133
strategy:
3234
matrix:
3335
service: ${{fromJSON(needs.setup.outputs.services)}}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# example-github-actions-dynamic-matrix
22

3+
[![Build Status](https://github.com/suzuki-shunsuke/example-github-actions-dynamic-matrix/workflows/test/badge.svg)](https://github.com/suzuki-shunsuke/example-github-actions-dynamic-matrix/actions)
4+
[![GitHub last commit](https://img.shields.io/github/last-commit/suzuki-shunsuke/example-github-actions-dynamic-matrix.svg)](https://github.com/suzuki-shunsuke/example-github-actions-dynamic-matrix)
5+
[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/suzuki-shunsuke/example-github-actions-dynamic-matrix/master/LICENSE)
6+
37
Example of GitHub Actions Workflow which runs a matrix build dynamically according to changed files in the pull request and pull request labels.
48

59
This is useful in case of Monorepo.

0 commit comments

Comments
 (0)