Skip to content

Commit

Permalink
Update GHA workflow to save the hash on a output variable
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Oct 29, 2024
1 parent dabd73a commit 96ba20d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ jobs:
runs-on: ubuntu-latest
env:
plugin_name: wazuh-indexer-${{ matrix.plugins }}
outputs:
hash: ${{ steps.save-hash.outputs.hash }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -152,7 +154,8 @@ jobs:
working-directory: ./plugins/${{ matrix.plugins }}

- name: Save commit hash
run: echo "plugins_hash=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
id: save-hash
run: echo "hash=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -164,6 +167,8 @@ jobs:
build-reporting-plugin:
if: ${{ inputs.reporting_plugin_ref != '' }}
runs-on: ubuntu-latest
outputs:
hash: ${{ steps.save-hash.outputs.hash }}
env:
plugin_name: wazuh-indexer-reports-scheduler
steps:
Expand All @@ -190,7 +195,8 @@ jobs:
- run: ls -lR build/distributions

- name: Save commit hash
run: echo "reporting_hash=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
id: save-hash
run: echo "hash=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -245,9 +251,10 @@ jobs:
id: min_package

- name: Run `baptizer.sh`
# As parameters
run: |
PLUGINS_HASH=${{ env.plugins_hash }} \
REPORTING_HASH=${{ env.reporting_hash }} \
PLUGINS_HASH=${{build-wazuh-plugins.outputs.hash }} \
REPORTING_HASH=${{ build-reporting-plugin.outputs.hash }} \
name=$(bash build-scripts/baptizer.sh \
-a ${{ matrix.architecture }} \
-d ${{ matrix.distribution }} \
Expand Down

0 comments on commit 96ba20d

Please sign in to comment.