Skip to content

Commit

Permalink
chore(action): properly load correct git version to be used to downlo…
Browse files Browse the repository at this point in the history
…ad images.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP committed Feb 9, 2024
1 parent 0134f74 commit b192fe5
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,34 @@ outputs:
runs:
using: "composite"
steps:
# If action_ref points to v0 or v0.3, expect to be on a tag,
# else expect that user passed either `main` or an hash.
- name: Fetch tag or hash to be used
shell: bash
working-directory: ${{ github.action_path }}
id: git
run: |
if [[ "$ACTION_REF" =~ ^v[0-9] ]]; then
GIT_VER=$(git tag --points-at HEAD)
else
GIT_VER=$ACTION_REF
fi
echo "git_ver=$GIT_VER" >> $GITHUB_OUTPUT
env:
ACTION_REF: ${{ github.action_ref }}

- name: Generate vars yaml
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: |
cat > vars.yml <<EOF
run_id: "id-${{ github.run_id }}"
output_dir: "~/ansible_output_${{ github.run_id }}"
tag: "${ACTION_REF}"
tag: "${{ steps.git.outputs.git_ver }}"
repos:
libs: {name: "falcosecurity-libs", repo: "https://github.com/${{ inputs.libsrepo }}.git", version: "${{ inputs.libsversion }}"}
EOF
env:
ACTION_REF: ${{ github.action_ref }}

- name: Bootstrap VMs
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
Expand Down

0 comments on commit b192fe5

Please sign in to comment.