Skip to content

Commit

Permalink
Add parameters and module name
Browse files Browse the repository at this point in the history
  • Loading branch information
vcerenu committed Sep 11, 2024
1 parent 9529600 commit 1cc301c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/Puppet_module_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ jobs:
- name: View parameters
run: echo "${{ toJson(inputs) }}"

- name: Verify Tag name
- name: Create environment variables for workflow
run: |
WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$)
PUPPET_MODULE_NAME=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g')
PUPPET_MODULE_VERSOIN=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g')
echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV"
echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV"
echo "PUPPET_MODULE_VERSOIN=$PUPPET_MODULE_VERSOIN" >> "$GITHUB_ENV"
- name: Install dependencies
run: |
Expand All @@ -60,7 +64,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Puppet module artifact
path: ${{ github.workspace }}/output/wazuh-wazuh-.tar.gz
path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz
retention-days: 1

- name: Configure aws credentials
Expand All @@ -74,5 +78,5 @@ jobs:

- name: Upload Puppet module to S3
if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }}
run: aws s3 cp ${{ github.workspace }}/output/*.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/
run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/

0 comments on commit 1cc301c

Please sign in to comment.