diff --git a/.github/workflows/build-rpm-packages.yml b/.github/workflows/build-rpm-packages.yml index 4ec751130f..9bf911c3fc 100644 --- a/.github/workflows/build-rpm-packages.yml +++ b/.github/workflows/build-rpm-packages.yml @@ -10,6 +10,8 @@ on: jobs: Wazuh-agent-rpm-package-build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} runs-on: ubuntu-latest strategy: matrix: @@ -68,8 +70,13 @@ jobs: if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || ((steps.changes.outputs.rpm_images_manager_x86_64 == 'true' || steps.changes.outputs.rpm_images_agent_x86_64 == 'true') && matrix.ARCHITECTURE == 'x86_64') working-directory: ./rpms run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/wazuh.git ${BRANCH_NAME}`" != "X" ]; then + W_BRANCH=${BRANCH_NAME} + else + W_BRANCH=${{ env.VERSION }} + fi REVISION=$( echo ${{ github.head_ref }} | sed 's/-/./g; s/\//./g' ) - bash generate_rpm_package.sh -b ${{ env.VERSION }} -t ${{ matrix.TYPE }} -a ${{ matrix.ARCHITECTURE }} --dev -j 2 --dont-build-docker --tag ${{ env.TAG }} -r $REVISION + bash generate_rpm_package.sh -b ${W_BRANCH} -t ${{ matrix.TYPE }} -a ${{ matrix.ARCHITECTURE }} --dev -j 2 --dont-build-docker --tag ${{ env.TAG }} -r $REVISION echo "PACKAGE_NAME=$(ls ./output | grep .rpm | head -n 1)" >> $GITHUB_ENV - name: Upload Wazuh ${{ matrix.TYPE }} ${{ matrix.ARCHITECTURE }} package as artifact diff --git a/rpms/SPECS/wazuh-manager.spec b/rpms/SPECS/wazuh-manager.spec index 5f0a512bb9..43602b1ebe 100644 --- a/rpms/SPECS/wazuh-manager.spec +++ b/rpms/SPECS/wazuh-manager.spec @@ -713,7 +713,8 @@ rm -fr %{buildroot} %attr(640, wazuh, wazuh) %ghost %{_localstatedir}/logs/integrations.log %attr(660, wazuh, wazuh) %ghost %{_localstatedir}/logs/ossec.log %attr(660, wazuh, wazuh) %ghost %{_localstatedir}/logs/ossec.json -%attr(0440, root, wazuh) %{_localstatedir}/queue/indexer/vd_states_template.json +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/templates +%attr(0440, root, wazuh) %{_localstatedir}/templates/vd_states_template.json %dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/api %dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/archives %dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/alerts