From 25810aa292e392a198bed19aeb5c136c692620a0 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 25 Apr 2021 15:50:08 +0900 Subject: [PATCH 1/4] docs: add status badges --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1cb2397..1b12e01 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # example-github-actions-dynamic-matrix +[![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) +[![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) +[![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) + Example of GitHub Actions Workflow which runs a matrix build dynamically according to changed files in the pull request and pull request labels. This is useful in case of Monorepo. From d82d3d79472cdf6954440594afba6fd08b27cdbc Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 25 Apr 2021 15:56:54 +0900 Subject: [PATCH 2/4] fix: add if condition to build job --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b28d402..a9f6f24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,7 @@ jobs: build: runs-on: ubuntu-latest needs: setup + if: fromJSON(needs.setup.outputs.services) strategy: matrix: service: ${{fromJSON(needs.setup.outputs.services)}} From 506d1e437aec5d8f1184060dca1ad9a55ef9d5e1 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 25 Apr 2021 15:58:46 +0900 Subject: [PATCH 3/4] fix: test if condition --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9f6f24..6e9067a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: build: runs-on: ubuntu-latest needs: setup - if: fromJSON(needs.setup.outputs.services) + if: false strategy: matrix: service: ${{fromJSON(needs.setup.outputs.services)}} From 0c5198ca7b9d01d34dde07b57e8645797a930993 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sun, 25 Apr 2021 16:02:20 +0900 Subject: [PATCH 4/4] fix: fix if condition --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e9067a..91ccfa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,8 @@ jobs: build: runs-on: ubuntu-latest needs: setup - if: false + # if services is empty, the build job is skipped + if: "join(fromJSON(needs.setup.outputs.services), '') != ''" strategy: matrix: service: ${{fromJSON(needs.setup.outputs.services)}}