Enhance GitHub Actions workflow for dynamic branch testing

- Added a step to check out the target branch specified in the workflow input.
- Implemented a conditional step to use the workflow file from the checked-out branch, improving flexibility and error handling in CI processes.
This commit is contained in:
amithkoujalgi 2025-08-30 18:06:06 +05:30
parent 0ec20d14b0
commit b91f6e6b25
No known key found for this signature in database
GPG Key ID: E29A37746AF94B70

View File

@ -16,10 +16,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - name: Checkout target branch
uses: actions/checkout@v3
with: with:
ref: ${{ github.event.inputs.branch }} ref: ${{ github.event.inputs.branch }}
- name: Use workflow from checked out branch
run: |
if [ -f .github/workflows/run-tests.yml ]; then
echo "Using workflow from checked out branch."
cp .github/workflows/run-tests.yml /tmp/run-tests.yml
exit 0
else
echo "Workflow file not found in checked out branch."
exit 1
fi
- name: Set up Ollama - name: Set up Ollama
run: | run: |
curl -fsSL https://ollama.com/install.sh | sh curl -fsSL https://ollama.com/install.sh | sh