GH-500 · Question #59
As a repository owner, you do not want to run a GitHub Actions workflow when changes are made to any .txt or markdown files. How would you adjust the event trigger for a pull request that targets…
The correct answer is A. paths-ignore: C. - '**/*.md' D. - '**/*.txt'. To skip workflow runs when only .txt or markdown files change, you use (A) paths-ignore: under the pull_request trigger, then list (C) - '*/.md' and (D) - '*/.txt' as glob patterns to exclude. The paths-ignore key tells GitHub Actions to skip the workflow if ALL changed files…
Question
Options
- Apaths-ignore:
- Bpaths:
- C
- '**/*.md'
- D
- '**/*.txt'
- E
- '/docs/.md'
How the community answered
(62 responses)- A82% (51)
- B13% (8)
- E5% (3)
Explanation
To skip workflow runs when only .txt or markdown files change, you use (A) paths-ignore: under the pull_request trigger, then list (C) - '**/*.md' and (D) - '**/*.txt' as glob patterns to exclude. The paths-ignore key tells GitHub Actions to skip the workflow if ALL changed files match the listed patterns. Using paths: (B) does the opposite - it only runs when matching files change. The pattern - '*/docs/*.md' (E) is too narrow and only matches markdown files one level inside a docs folder.
Topics
Community Discussion
No community discussion yet for this question.