如果我理解正确,您需要except:changes
在 CI 文件中有约定。
看看这个例子。如果 *.md、eslintrc.json 和 jsconfig.json 发生更改,则作业会在任何条件下运行。在这种情况下,管道将不会运行。检查以下示例的异常更改阶段。
另一方面,您可以设置在任何js文件发生更改的情况下运行管道。检查以下示例的 * only-changes* 阶段。
stages:
- except-changes
- only-changes
ignore-file-changes:
stage: except-changes
script:
- echo "Skip running the pipeline if *.md, eslintrc.json and jsconfig.json has any kind of change."
except:
changes:
- "**/*.md"
- eslintrc.json
- jsconfig.json
- README.md
pass-the-pipeline:
stage: only-changes
script:
- echo "Run only *.js and Dockerfile files has any kind of change."
only:
changes:
- Dockerfile
- "**/*.js"