Skip to content

Commit a705980

Browse files
committed
Fix Build workflow to run on push events (#134)
* Run workflow on push * Set build workflow inputs to required * Normalize the use of quotes for the build workflow inputs * Add ternary operator * Add missing ternary operator
1 parent 45f872b commit a705980

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

.github/workflows/build.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ name: Build packages
33
# This workflow runs when any of the following occur:
44
# - Run manually
55
on:
6-
pull_request:
6+
push:
77
# Sequence of patterns matched against refs/heads
88
branches:
99
- 'ci/*'
1010
workflow_dispatch:
1111
inputs:
1212
revision:
13-
# description:
14-
default: "1"
15-
required: false
13+
description: "Any string or number used to extend the package's identifier"
1614
type: string
15+
required: true
16+
default: "1"
1717

1818
# ==========================
1919
# Bibliography
@@ -25,6 +25,8 @@ on:
2525
# | https://docs.github.com/en/actions/using-workflows/reusing-workflows#using-a-matrix-strategy-with-a-reusable-workflow
2626
# * Reading input from the called workflow
2727
# | https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputs
28+
# * Ternary operator
29+
# | https://docs.github.com/en/actions/learn-github-actions/expressions#example
2830

2931
jobs:
3032
version:
@@ -43,8 +45,8 @@ jobs:
4345
with:
4446
architecture: ${{ matrix.architecture }}
4547
distribution: ${{ matrix.distribution }}
46-
revision: ${{ inputs.revision }}
47-
name: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }}
48+
revision: ${{ github.event_name == 'push' && '1' || inputs.revision }}
49+
name: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }}
4850

4951
assemble:
5052
needs: [version, commit_sha, build]
@@ -61,4 +63,4 @@ jobs:
6163
with:
6264
architecture: ${{ matrix.architecture }}
6365
distribution: ${{ matrix.distribution }}
64-
min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }}
66+
min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }}

.github/workflows/r_assemble.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ on:
66
workflow_call:
77
inputs:
88
distribution:
9-
description: 'One of [ "tar", "rpm", "deb" ]'
9+
description: "One of [ 'tar', 'rpm', 'deb' ]"
1010
default: "rpm"
11-
required: false
11+
required: true
1212
type: string
1313
architecture:
14-
description: 'One of [ "x64", "arm64" ]'
14+
description: "One of [ 'x64', 'arm64' ]"
1515
default: "x64"
16-
required: false
16+
required: true
1717
type: string
1818
min:
19-
description: The name of the package to download.
19+
description: "The name of the package to download."
2020
required: true
2121
type: string
2222

.github/workflows/r_build.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ on:
66
workflow_call:
77
inputs:
88
distribution:
9-
description: 'One of [ "tar", "rpm", "deb" ]'
9+
description: "One of [ 'tar', 'rpm', 'deb' ]"
1010
default: "rpm"
11-
required: false
11+
required: true
1212
type: string
1313
architecture:
14-
description: 'One of [ "x64", "arm64" ]'
14+
description: "One of [ 'x64', 'arm64' ]"
1515
default: "x64"
16-
required: false
16+
required: true
1717
type: string
1818
revision:
19+
description: "Any string or number used to extend the package's identifier."
1920
type: string
21+
required: true
22+
default: "1"
2023
name:
21-
description: The name of the package to upload.
24+
description: "The name of the package to upload."
2225
required: true
2326
type: string
2427

0 commit comments

Comments
 (0)