ci: conditional execution of composite actions #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate docs | |
on: | |
workflow_call: | |
pull_request: | |
# If not specified, types includes by default [opened, reopened, synchronize] | |
# This next line should be used in conjunction with the if statement that prevents CI jobs to run on draft PRs. | |
# ready_for_review is then added to make sure that a PR with no code change triggers CI if it's no longer a draft PR. | |
types: [ opened, reopened, synchronize, ready_for_review ] | |
permissions: | |
contents: read | |
jobs: | |
validate: | |
name: Validate docs | |
# Preventing a job from running on draft PRs. | |
if: '! github.event.pull_request.draft' | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Detect changes | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
docs: | |
- 'docs/**' | |
- '/README.md' | |
- name: docs ci action | |
if: steps.filter.outputs.docs == 'true' | |
uses: ./.github/actions/docs-ci-action |