Skip to content

Commit c3db9e9

Browse files
Merge pull request #1239 from NordicSemiconductor/echo_input
Echo workflow inputs
2 parents e1cb575 + d967875 commit c3db9e9

File tree

9 files changed

+154
-5
lines changed

9 files changed

+154
-5
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Build
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description:
8+
Ref (Tag, branch, commit SHA) to build.
9+
Defaults to the ref of the workflow.
10+
type: string
511
workflow_call:
612
inputs:
713
ref:
@@ -12,8 +18,8 @@ on:
1218
description: Whether the build completed successfully
1319
value:
1420
${{
15-
jobs.windows.result == 'success' &&
16-
jobs.linux.result == 'success' &&
21+
jobs.windows.result == 'success' &&
22+
jobs.linux.result == 'success' &&
1723
jobs.darwin_x64.result == 'success' &&
1824
jobs.darwin_arm64.result == 'success'
1925
}}
@@ -27,6 +33,19 @@ on:
2733
- doc/**
2834

2935
jobs:
36+
echo-inputs:
37+
runs-on: ubuntu-latest
38+
name: Inputs
39+
steps:
40+
- uses: actions/github-script@v8
41+
env:
42+
REF: ${{ inputs.ref }}
43+
FALLBACK_REF: ${{ github.ref_name }}
44+
with:
45+
script: |
46+
core.summary.addHeading('Workflow inputs', '2');
47+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
48+
core.summary.write();
3049
windows:
3150
uses: ./.github/workflows/build_win.yml
3251
secrets: inherit

.github/workflows/build_darwin.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ on:
1414
- x64
1515
ref:
1616
description:
17-
Ref (Tag, branch, commit SHA) to release.
17+
Ref (Tag, branch, commit SHA) to build.
1818
Defaults to the ref of the workflow.
1919
type: string
20+
echo-inputs:
21+
description: Print the workflow inputs.
22+
type: boolean
23+
default: true
2024
workflow_call:
2125
inputs:
2226
arch:
@@ -26,13 +30,27 @@ on:
2630
ref:
2731
description: Ref to build from
2832
type: string
33+
echo-inputs:
34+
type: boolean
35+
default: false
2936

3037
jobs:
3138
build:
3239
name: Build macOS ${{ inputs.arch }}
3340
# For arm64 use macos-latest, for x64 use macos-15-intel (See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#choosing-github-hosted-runners)
3441
runs-on: ${{ inputs.arch == 'arm64' && 'macos-latest' || 'macos-15-intel' }}
3542
steps:
43+
- uses: actions/github-script@v8
44+
if: inputs.echo-inputs
45+
env:
46+
REF: ${{ inputs.ref }}
47+
FALLBACK_REF: ${{ github.ref_name }}
48+
with:
49+
script: |
50+
core.summary.addHeading('Workflow inputs', '2');
51+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
52+
core.summary.write();
53+
3654
- uses: actions/checkout@v4
3755
with:
3856
ref: ${{ inputs.ref }}

.github/workflows/build_linux.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,38 @@ on:
55
inputs:
66
ref:
77
description:
8-
Ref (Tag, branch, commit SHA) to release.
8+
Ref (Tag, branch, commit SHA) to build.
99
Defaults to the ref of the workflow.
1010
type: string
11+
echo-inputs:
12+
description: Print the workflow inputs.
13+
type: boolean
14+
default: true
1115
workflow_call:
1216
inputs:
1317
ref:
1418
description: Ref to build from
1519
type: string
20+
echo-inputs:
21+
type: boolean
22+
default: false
1623

1724
jobs:
1825
build:
1926
name: Build Linux
2027
runs-on: ubuntu-latest
2128
steps:
29+
- uses: actions/github-script@v8
30+
if: inputs.echo-inputs
31+
env:
32+
REF: ${{ inputs.ref }}
33+
FALLBACK_REF: ${{ github.ref_name }}
34+
with:
35+
script: |
36+
core.summary.addHeading('Workflow inputs', '2');
37+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
38+
core.summary.write();
39+
2240
- uses: actions/checkout@v4
2341
with:
2442
ref: ${{ inputs.ref }}

.github/workflows/build_win.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,38 @@ on:
55
inputs:
66
ref:
77
description:
8-
Ref (Tag, branch, commit SHA) to release.
8+
Ref (Tag, branch, commit SHA) to build.
99
Defaults to the ref of the workflow.
1010
type: string
11+
echo-inputs:
12+
description: Print the workflow inputs.
13+
type: boolean
14+
default: true
1115
workflow_call:
1216
inputs:
1317
ref:
1418
description: Ref to build from
1519
type: string
20+
echo-inputs:
21+
type: boolean
22+
default: false
1623

1724
jobs:
1825
build:
1926
name: Build Windows
2027
runs-on: windows-latest
2128
steps:
29+
- uses: actions/github-script@v8
30+
if: inputs.echo-inputs
31+
env:
32+
REF: ${{ inputs.ref }}
33+
FALLBACK_REF: ${{ github.ref_name }}
34+
with:
35+
script: |
36+
core.summary.addHeading('Workflow inputs', '2');
37+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
38+
core.summary.write();
39+
2240
- uses: actions/checkout@v4
2341
with:
2442
ref: ${{ inputs.ref }}

.github/workflows/continue-release-common.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ on:
1313
type: string
1414

1515
jobs:
16+
echo-inputs:
17+
runs-on: ubuntu-latest
18+
name: Inputs
19+
steps:
20+
- uses: actions/github-script@v8
21+
env:
22+
RELEASE_TYPE: ${{ inputs.release-type }}
23+
TAG: ${{ inputs.tag }}
24+
with:
25+
script: |
26+
core.summary.addHeading('Workflow inputs', '2');
27+
core.summary.addTable([
28+
['Release Type', `<code>${process.env.RELEASE_TYPE}</code>`],
29+
['Tag', `<code>${process.env.TAG}</code>`]]);
30+
core.summary.write();
1631
check-type:
1732
name: Check release type
1833
runs-on: ubuntu-latest

.github/workflows/docs-bundle.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ on:
1515
type: string
1616

1717
jobs:
18+
echo-inputs:
19+
runs-on: ubuntu-latest
20+
name: Inputs
21+
steps:
22+
- uses: actions/github-script@v8
23+
if: github.event_name == 'workflow_dispatch'
24+
env:
25+
REF: ${{ inputs.ref }}
26+
FALLBACK_REF: ${{ github.ref_name }}
27+
with:
28+
script: |
29+
core.summary.addHeading('Workflow inputs', '2');
30+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
31+
core.summary.write();
1832
create-doc-bundle:
1933
uses: NordicSemiconductor/pc-nrfconnect-shared/.github/workflows/docs-bundle.yml@main
2034
with:

.github/workflows/docs-publish-dev.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ on:
1616
type: string
1717

1818
jobs:
19+
echo-inputs:
20+
runs-on: ubuntu-latest
21+
name: Inputs
22+
steps:
23+
- uses: actions/github-script@v8
24+
if: github.event_name == 'workflow_dispatch'
25+
env:
26+
REF: ${{ inputs.ref }}
27+
FALLBACK_REF: ${{ github.ref_name }}
28+
with:
29+
script: |
30+
core.summary.addHeading('Workflow inputs', '2');
31+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
32+
core.summary.write();
1933
publish-docs-bundle:
2034
uses: NordicSemiconductor/pc-nrfconnect-shared/.github/workflows/docs-publish.yml@main
2135
with:

.github/workflows/docs-publish-prod.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ on:
1414
type: string
1515

1616
jobs:
17+
echo-inputs:
18+
runs-on: ubuntu-latest
19+
name: Inputs
20+
steps:
21+
- uses: actions/github-script@v8
22+
if: github.event_name == 'workflow_dispatch'
23+
env:
24+
REF: ${{ inputs.ref }}
25+
FALLBACK_REF: ${{ github.ref_name }}
26+
with:
27+
script: |
28+
core.summary.addHeading('Workflow inputs', '2');
29+
core.summary.addTable([['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`]]);
30+
core.summary.write();
1731
publish-docs-bundle:
1832
uses: NordicSemiconductor/pc-nrfconnect-shared/.github/workflows/docs-publish.yml@main
1933
with:

.github/workflows/release-common.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@ on:
1616
type: string
1717

1818
jobs:
19+
echo-inputs:
20+
runs-on: ubuntu-latest
21+
name: Inputs
22+
steps:
23+
- uses: actions/github-script@v8
24+
env:
25+
REF: ${{ inputs.ref }}
26+
FALLBACK_REF: ${{ github.ref_name }}
27+
RELEASE_TYPE: ${{ inputs.release-type }}
28+
TAG: ${{ inputs.tag }}
29+
with:
30+
script: |
31+
core.summary.addHeading('Workflow inputs', '2');
32+
core.summary.addTable([
33+
['Ref', process.env.REF ? `<code>${process.env.REF}</code>` : `not set explicitly, using ref <code>${process.env.FALLBACK_REF}</code>`],
34+
['Release Type', `<code>${process.env.RELEASE_TYPE}</code>`],
35+
['Tag', `<code>${process.env.TAG}</code>`]
36+
]);
37+
core.summary.write();
1938
check-type:
2039
name: Check release type
2140
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)