Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit e49710e

Browse files
committed
build: adding additional option for provenance generation in non-main branches
1 parent 410a6d7 commit e49710e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/manual-publish.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ on:
1414
type: boolean
1515
required: true
1616
generate_provenance:
17-
description: 'Whether or not to generate provenance for this manual publish.'
18-
type: boolean
19-
required: true
17+
description: 'Whether or not to generate provenance for this manual publish. Default behavior: generate only on main branch.'
18+
type: choice
19+
options:
20+
- Default
21+
- Generate
22+
- Do not generate
2023

2124
jobs:
2225
build:
@@ -62,7 +65,9 @@ jobs:
6265
id-token: write
6366
contents: write
6467
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
65-
if: ${{ inputs.generate_provenance && inputs.pkg_name == 'LaunchDarkly.ServerSdk' }}
68+
if: |
69+
(inputs.generate_provenance == 'Generate' || (inputs.generate_provenance == 'Default' && github.ref_name == 'main')) &&
70+
inputs.pkg_name == 'LaunchDarkly.ServerSdk'
6671
with:
6772
base64-subjects: "${{ needs.build.outputs.server-sdk-hashes }}"
6873
upload-assets: true
@@ -76,7 +81,9 @@ jobs:
7681
id-token: write
7782
contents: write
7883
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
79-
if: ${{ inputs.generate_provenance && inputs.pkg_name == 'LaunchDarkly.ServerSdk.Telemetry' }}
84+
if: |
85+
(inputs.generate_provenance == 'Generate' || (inputs.generate_provenance == 'Default' && github.ref_name == 'main')) &&
86+
inputs.pkg_name == 'LaunchDarkly.ServerSdk.Telemetry'
8087
with:
8188
base64-subjects: "${{ needs.build.outputs.telemetry-hashes }}"
8289
upload-assets: true

0 commit comments

Comments
 (0)