我写了一个Github操作工作流,只有当一些特定的文件更新时才会触发:
name: CI
on:
push:
paths:
### If a push was applied on one of these files, the CI workflow is triggered.###
### I want to know which file triggered the CI workflow and save it to a variable s I can use later in the CI steps ###
- 'dwh/helm/values-versions.yaml'
- 'ai/helm/values-versions.yaml'
- 'platform/helm/values-versions.yaml'
jobs:
copy-values-template-to-fluent-bit:
runs-on: self-hosted
container:
image: ghcr.io/***/myImage
credentials:
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_PASS }}
steps:
- uses: actions/checkout@v2
- name: show repo files
run: |
pwd
ls -l我需要一种方法来找出是哪个文件触发了CI工作流,并将其保存到一个变量中。
发布于 2021-07-06 21:15:24
您可以使用此操作Get All Changed Files
- id: files
uses: jitterbit/get-changed-files@v1
- run: |
for changed_file in ${{ steps.files.outputs.all }}; do
echo "Do something with this ${changed_file} to check if this is you file and set variable."
donehttps://stackoverflow.com/questions/68269467
复制相似问题