Ignore .md files for github workflows #3
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: Skip builds for docs | |
on: | |
push: | |
tags: [ "v**" ] | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "**" ] | |
jobs: | |
docs_only_check: | |
name: Check for docs-only change | |
outputs: | |
docs_only: ${{ steps.docs_only_check.outputs.docs_only }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 10 | |
- id: files | |
name: Get changed files | |
uses: tj-actions/changed-files@v23.1 | |
with: | |
files_ignore: /**/*.yml|README.md #change this to docs paths | |
files_ignore_separator: '|' | |
- id: docs_only_check | |
if: steps.files.outputs.any_changed != 'true' | |
name: Check for docs-only changes | |
run: echo '::set-output name=docs_only::DOCS_ONLY' | |
can_merge: | |
runs-on: ubuntu-latest | |
if: | | |
always() && | |
!failure() && | |
!cancelled() | |
needs: [docs_only_check] | |
steps: | |
- run: "can_merge_docs_only=\"${{ needs.docs_only_check.outputs.docs_only\ | |
\ }}\"\nif [[ ${can_merge_docs_only} == \"DOCS_ONLY\" ]] \nthen\n\ | |
\ echo \"CAN MERGE\"\n exit 0\nelse\n echo\ | |
\ \"CANNOT MERGE\"\n exit 1\nfi\n" |