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"
  steps:
    - name: Get changed files
      id: get_changed_files
      shell: bash
      run: |
        # Get the list of changed files
        CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})

    - name: Setup Sectool
      uses: a13labs/setup-sectool@v1

    - name: Install Python and required packages
      shell: bash
      run: |
        sudo apt-get update
        sudo apt-get install -y python3-pip
