Skip to content

Commit 23a1b83

Browse files
committed
chore(ci): remove attestation details from workflow summaries
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com> Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
1 parent ff8cbfd commit 23a1b83

File tree

2 files changed

+6
-135
lines changed

2 files changed

+6
-135
lines changed

.github/workflows/cli-release.yml

Lines changed: 4 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,6 @@ jobs:
143143
repository: ${{ github.repository }}
144144
name: ${{ needs.build.outputs.artifact_name }}
145145

146-
- name: Append attestation references to RC notes
147-
run: |
148-
{
149-
echo ""
150-
echo "## Build Metadata"
151-
if [ -n "${{ needs.build.outputs.binary_attestation_url }}" ]; then
152-
echo "- Attestation created (binaries): ${{ needs.build.outputs.binary_attestation_url }}"
153-
fi
154-
if [ -n "${{ needs.build.outputs.oci_attestation_url }}" ]; then
155-
echo "- Attestation created (oci): ${{ needs.build.outputs.oci_attestation_url }}"
156-
fi
157-
} >> "${{ runner.temp }}/CHANGELOG.md"
158-
159146
- name: Create RC Release
160147
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
161148
with:
@@ -197,49 +184,6 @@ jobs:
197184
return;
198185
}
199186
200-
# ----------------------------------------------------------------
201-
# 5b. Resolve RC metadata used for final summaries
202-
# ----------------------------------------------------------------
203-
resolve_rc_metadata:
204-
name: Resolve RC Metadata for Final Summaries
205-
if: ${{ github.event.inputs.release_candidate == 'false' }}
206-
needs: [prepare, validate_final]
207-
runs-on: ubuntu-latest
208-
outputs:
209-
rc_binary_attestation_url: ${{ steps.resolve.outputs.rc_binary_attestation_url }}
210-
rc_oci_attestation_url: ${{ steps.resolve.outputs.rc_oci_attestation_url }}
211-
steps:
212-
- name: Resolve attestation links from RC release body
213-
id: resolve
214-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
215-
env:
216-
RC_TAG: ${{ needs.prepare.outputs.latest_rc_tag }}
217-
with:
218-
github-token: ${{ secrets.GITHUB_TOKEN }}
219-
script: |
220-
const tag = process.env.RC_TAG;
221-
if (!tag) {
222-
core.setFailed('Missing RC_TAG');
223-
return;
224-
}
225-
226-
const release = await github.rest.repos.getReleaseByTag({
227-
owner: context.repo.owner,
228-
repo: context.repo.repo,
229-
tag,
230-
});
231-
232-
const body = release.data.body || '';
233-
const binary = body.match(/Attestation created \(binaries\):\s*(https:\/\/github\.com\/[^\s]+)/i);
234-
const oci = body.match(/Attestation created \(oci\):\s*(https:\/\/github\.com\/[^\s]+)/i);
235-
236-
core.setOutput('rc_binary_attestation_url', binary ? binary[1] : '');
237-
core.setOutput('rc_oci_attestation_url', oci ? oci[1] : '');
238-
239-
if (!binary && !oci) {
240-
core.warning(`No dedicated attestation links found in RC release body for tag ${tag}`);
241-
}
242-
243187
# --------------------------------------------------------
244188
# 6. Tag Final: Create and push final tag from RC commit
245189
# --------------------------------------------------------
@@ -320,7 +264,7 @@ jobs:
320264
promote_image:
321265
name: Promote OCI Image to Final and Latest
322266
if: ${{ github.event.inputs.release_candidate == 'false' && github.event.inputs.dry_run == 'false' }}
323-
needs: [prepare, validate_final, resolve_rc_metadata, tag_final]
267+
needs: [prepare, validate_final, tag_final]
324268
runs-on: ubuntu-latest
325269
permissions:
326270
packages: write
@@ -342,14 +286,12 @@ jobs:
342286
RC_VERSION: ${{ needs.prepare.outputs.latest_rc_version }}
343287
FINAL_VERSION: ${{ needs.prepare.outputs.latest_promotion_version }}
344288
TARGET_REPO: ${{ env.REGISTRY }}/${{ github.repository_owner }}/cli
345-
RC_OCI_ATTESTATION_URL: ${{ needs.resolve_rc_metadata.outputs.rc_oci_attestation_url }}
346289
with:
347290
script: |
348291
const { execSync } = require('child_process');
349292
const rcVersion = process.env.RC_VERSION;
350293
const finalVersion = process.env.FINAL_VERSION;
351294
const targetRepo = process.env.TARGET_REPO;
352-
const rcOciAttestationUrl = process.env.RC_OCI_ATTESTATION_URL;
353295
if (!rcVersion) {
354296
core.setFailed('Missing RC_VERSION');
355297
return;
@@ -368,26 +310,15 @@ jobs:
368310
['Source Tag', `${targetRepo}:${rcVersion}`],
369311
['Promoted Tags', `${targetRepo}:${finalVersion}, ${targetRepo}:latest`],
370312
])
371-
.addHeading('Attestation');
372-
373-
if (rcOciAttestationUrl) {
374-
await core.summary
375-
.addLink(rcOciAttestationUrl, rcOciAttestationUrl)
376-
.write();
377-
} else {
378-
await core.summary
379-
.addRaw('No dedicated RC OCI attestation URL found in RC release notes.')
380-
.addEOL()
381-
.write();
382-
}
313+
.write();
383314
384315
# --------------------------------------------------------
385316
# 8. Release Final: Create GitHub final release from RC assets
386317
# --------------------------------------------------------
387318
release_final:
388319
name: Create Final Release from RC
389320
if: ${{ github.event.inputs.release_candidate == 'false' && github.event.inputs.dry_run == 'false' }}
390-
needs: [prepare, validate_final, resolve_rc_metadata, tag_final, promote_image]
321+
needs: [prepare, validate_final, tag_final, promote_image]
391322
runs-on: ubuntu-latest
392323
permissions:
393324
contents: write
@@ -427,8 +358,6 @@ jobs:
427358
env:
428359
RC_TAG: ${{ needs.prepare.outputs.latest_rc_tag }}
429360
RC_VERSION: ${{ needs.prepare.outputs.latest_rc_version }}
430-
RC_BINARY_ATTESTATION_URL: ${{ needs.resolve_rc_metadata.outputs.rc_binary_attestation_url }}
431-
RC_OCI_ATTESTATION_URL: ${{ needs.resolve_rc_metadata.outputs.rc_oci_attestation_url }}
432361
FINAL_TAG: ${{ needs.prepare.outputs.latest_promotion_tag }}
433362
FINAL_VERSION: ${{ needs.prepare.outputs.latest_promotion_version }}
434363
TARGET_REPO: ${{ env.REGISTRY }}/${{ github.repository_owner }}/cli
@@ -444,8 +373,6 @@ jobs:
444373
const finalVersion = process.env.FINAL_VERSION;
445374
const rcTag = process.env.RC_TAG;
446375
const rcVersion = process.env.RC_VERSION;
447-
const rcBinaryAttestationUrl = process.env.RC_BINARY_ATTESTATION_URL;
448-
const rcOciAttestationUrl = process.env.RC_OCI_ATTESTATION_URL;
449376
const targetRepo = process.env.TARGET_REPO;
450377
const downloadDir = process.env.DOWNLOAD_DIR;
451378
const notesFile = process.env.NOTES_FILE;
@@ -498,27 +425,4 @@ jobs:
498425
['OCI Tags', `${targetRepo}:${finalVersion}, ${targetRepo}:latest (from ${rcVersion || 'n/a'})`],
499426
['Uploaded Assets', String(files.length)],
500427
])
501-
.addHeading('Attestation');
502-
503-
if (rcOciAttestationUrl) {
504-
await core.summary
505-
.addRaw('OCI: ')
506-
.addLink(rcOciAttestationUrl, rcOciAttestationUrl)
507-
.addEOL()
508-
.write();
509-
}
510-
511-
if (rcBinaryAttestationUrl) {
512-
await core.summary
513-
.addRaw('Binaries: ')
514-
.addLink(rcBinaryAttestationUrl, rcBinaryAttestationUrl)
515-
.addEOL()
516-
.write();
517-
}
518-
519-
if (!rcOciAttestationUrl && !rcBinaryAttestationUrl) {
520-
await core.summary
521-
.addRaw('No dedicated RC attestation URL found in RC release notes.')
522-
.addEOL()
523-
.write();
524-
}
428+
.write();

.github/workflows/cli.yml

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ on:
3434
artifact_id:
3535
description: "The artifact id that was built."
3636
value: ${{ jobs.build.outputs.artifact_id }}
37-
binary_attestation_url:
38-
description: "Attestation URL for built binaries (if created)."
39-
value: ${{ jobs.build.outputs.binary_attestation_url }}
40-
oci_attestation_url:
41-
description: "Attestation URL for OCI image (if created)."
42-
value: ${{ jobs.publish.outputs.oci_attestation_url }}
4337

4438
env:
4539
LOCATION: "cli" # Folder containing the CLI source
@@ -62,7 +56,6 @@ jobs:
6256
artifact_name: ${{ env.ARTIFACT_NAME }}
6357
artifact_id: ${{ steps.upload-artifacts.outputs.artifact_id }}
6458
should_push_oci_image: ${{ steps.branch-check.outputs.should_push_oci_image }} # Used by publish job
65-
binary_attestation_url: ${{ steps.attest_binaries.outputs.attestation-url }}
6659
permissions:
6760
contents: read
6861
id-token: write # Needed for provenance attestations
@@ -117,23 +110,11 @@ jobs:
117110
# Attest built binaries with provenance metadata, but only if we're not on a PR
118111
- name: Attest binaries
119112
if: ${{ github.event_name != 'pull_request' }}
120-
id: attest_binaries
121113
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
122114
with:
123115
github-token: ${{ secrets.GITHUB_TOKEN }}
124116
subject-path: "${{ env.LOCATION }}/tmp/bin/ocm-*"
125-
126-
- name: Summarize binary attestation
127-
if: ${{ github.event_name != 'pull_request' && steps.attest_binaries.outputs.attestation-url != '' }}
128-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
129-
env:
130-
ATTESTATION_URL: ${{ steps.attest_binaries.outputs.attestation-url }}
131-
with:
132-
script: |
133-
await core.summary
134-
.addHeading('Attestation created')
135-
.addLink(process.env.ATTESTATION_URL, process.env.ATTESTATION_URL)
136-
.write();
117+
show-summary: false
137118

138119
# Determine if this branch is eligible for publishing, but only if we're not on a PR
139120
- name: Determine if this is a push-eligible branch
@@ -173,8 +154,6 @@ jobs:
173154
packages: write # Needed for pushing OCI images and provenance layers
174155
id-token: write # Needed for provenance attestation identity
175156
attestations: write # Allows storing provenance attestation
176-
outputs:
177-
oci_attestation_url: ${{ steps.attest_oci.outputs.attestation-url }}
178157
steps:
179158
# Retrieve artifacts produced by the build job
180159
- name: Download build artifacts
@@ -227,22 +206,10 @@ jobs:
227206
id: digest
228207
run: echo "digest=$(oras resolve ${TARGET_REPO}:${TAG})" >> "$GITHUB_OUTPUT"
229208
- name: Attest OCI image
230-
id: attest_oci
231209
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
232210
with:
233211
github-token: ${{ secrets.GITHUB_TOKEN }}
234212
subject-digest: ${{ steps.digest.outputs.digest }}
235213
subject-name: ${{ env.TARGET_REPO }}
236214
push-to-registry: true
237-
238-
- name: Summarize OCI attestation
239-
if: ${{ steps.attest_oci.outputs.attestation-url != '' }}
240-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
241-
env:
242-
ATTESTATION_URL: ${{ steps.attest_oci.outputs.attestation-url }}
243-
with:
244-
script: |
245-
await core.summary
246-
.addHeading('Attestation created')
247-
.addLink(process.env.ATTESTATION_URL, process.env.ATTESTATION_URL)
248-
.write();
215+
show-summary: false

0 commit comments

Comments
 (0)