From a443b56c302aa626964474d49f067196d626d7f1 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Mon, 13 Feb 2023 14:13:15 +0100 Subject: [PATCH 1/4] Set status check to success in case it's a only-docs PR --- .github/workflows/test-docs.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/test-docs.yml diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml new file mode 100644 index 000000000..d61d042cc --- /dev/null +++ b/.github/workflows/test-docs.yml @@ -0,0 +1,16 @@ +--- +# This workflow sets the test / all status check to success in case it's a docs only PR and test.yml is not triggered +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks +name: test + +on: + pull_request: + paths: + - '**/*.md' + - '**/*.asciidoc' + +jobs: + all: + runs-on: ubuntu-latest + steps: + - run: 'echo "No build required"' From 6692d8c710a7f1a0ee00ad0f5340ad8c97c7febd Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Mon, 13 Feb 2023 14:22:13 +0100 Subject: [PATCH 2/4] Set permissions --- .github/workflows/test-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index d61d042cc..accef46fe 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -9,6 +9,9 @@ on: - '**/*.md' - '**/*.asciidoc' +permissions: + contents: read + jobs: all: runs-on: ubuntu-latest From 33867e5ca2f606c6e6c672bc02808a40f2e79247 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Mon, 13 Feb 2023 14:35:13 +0100 Subject: [PATCH 3/4] fix path patterns --- .github/workflows/test-docs.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index accef46fe..384831059 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -5,9 +5,10 @@ name: test on: pull_request: - paths: - - '**/*.md' - - '**/*.asciidoc' + paths-ignore: # This expression needs to match the paths ignored on test.yml. + - '**' + - '!**/*.md' + - '!**/*.asciidoc' permissions: contents: read From 68a1953f159ee907f9026081c9e87994940164da Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Mon, 13 Feb 2023 14:39:00 +0100 Subject: [PATCH 4/4] Add comments --- .github/workflows/test-docs.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index 384831059..86cb9c0a4 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -1,7 +1,7 @@ --- # This workflow sets the test / all status check to success in case it's a docs only PR and test.yml is not triggered # https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks -name: test +name: test # The name must be the same as in test.yml on: pull_request: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1f9a105c..1ccf0e0e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: test +name: test # The name must be the same as in test-docs.yml on: workflow_call: ~