From 87fe65a8a0f655314179407520116ea50385b979 Mon Sep 17 00:00:00 2001 From: Alexandre Pires Date: Sun, 29 Sep 2024 18:35:30 +0200 Subject: [PATCH] Refactor file path in actions-validate.yml and add output for changed files --- .github/actions/setup-env/action.yml | 4 ++++ .github/workflows/ansible-apply-playbook.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index e1e33bb..f46f585 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -1,5 +1,9 @@ name: Setup Environment description: Prepare the environment for A13labs CI/CD pipelines +outputs: + changed_files: + description: The list of changed files in the current pull request + value: ${{ steps.get_changed_files.outputs.CHANGED_FILES }} runs: using: "composite" diff --git a/.github/workflows/ansible-apply-playbook.yml b/.github/workflows/ansible-apply-playbook.yml index 7cd06a5..57ea9b1 100644 --- a/.github/workflows/ansible-apply-playbook.yml +++ b/.github/workflows/ansible-apply-playbook.yml @@ -32,6 +32,7 @@ jobs: VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }} ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }} SSH_AUTH_SOCK: /tmp/ssh_agent.sock + CHANGED_FILES: ${{ steps.get_changed_files.outputs.CHANGED_FILES }} run: | cd ansible for PLAYBOOK in $(echo $CHANGED_FILES | grep -oP 'playbook_\K\w+'); do