Update a.yml #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Checkout testing | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
wazuh_version: | |
description: 'Identifier of the generated content. The generated file will be named vd_1.0.0_vd_<wazuh_version>.tar.xz' | |
required: true | |
type: string | |
jobs: | |
checkout_testing: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# Idenentifiers of the generated content. The generated files will be named vd_1.0.0_vd_<wazuh_version>.tar.xz | |
wazuh_version: ["testing", "testing2", "invalid branch"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
ref: ${{ matrix.wazuh_version }} | |
# Checkout to the tag | |
# If the tag does not exist, checkout to the branch | |
# If the branch does not exist, exit with an error | |
- name: Checkout to wazuh_version | |
run: | | |
if git show-ref --tags --verify --quiet "refs/tags/v${{ matrix.wazuh_version }}"; then | |
git checkout --quiet "tags/v${{ matrix.wazuh_version }}" | |
else | |
echo "Warning: Unable to find tag v${{ matrix.wazuh_version }}. Continuing with branch ${{ matrix.wazuh_version }}" | |
fi |