Skip to content

Commit

Permalink
chore(action): use directly action_ref.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Feb 9, 2024
1 parent e49c7ee commit bf87c09
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,19 @@ 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: "${{ steps.git.outputs.git_ver }}"
tag: "$ACTION_REF"
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
Expand Down

0 comments on commit bf87c09

Please sign in to comment.