Skip to content

Commit 497feb4

Browse files
authored
feat(github): Use regular CLI steps in scorecards workflow (#1723)
Signed-off-by: Javier Rodriguez <[email protected]>
1 parent 1d8b214 commit 497feb4

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

.github/workflows/scorecards.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,35 @@ on:
1818
permissions: read-all
1919

2020
jobs:
21-
chainloop_init:
22-
name: Chainloop Init
23-
uses: chainloop-dev/labs/.github/workflows/chainloop_init.yml@64839eb68c20fefda46929c6c6e893cdf0537619
24-
secrets:
25-
api_token: ${{ secrets.CHAINLOOP_TOKEN }}
26-
with:
27-
workflow_name: "chainloop-vault-scorecards"
28-
project_name: "chainloop"
29-
3021
analysis:
3122
name: Scorecard analysis
3223
runs-on: ubuntu-latest
33-
needs:
34-
- chainloop_init
3524
permissions:
3625
# Needed to upload the results to code-scanning dashboard.
3726
security-events: write
3827
# Needed to publish results and get a badge (see publish_results below).
3928
id-token: write
4029
contents: read
4130
actions: read
31+
env:
32+
CHAINLOOP_WORKFLOW_NAME: "chainloop-vault-scorecards"
33+
CHAINLOOP_PROJECT: "chainloop"
34+
CHAINLOOP_TOKEN: ${{ secrets.CHAINLOOP_TOKEN }}
4235

4336
steps:
37+
- name: Install Chainloop
38+
run: |
39+
curl -sfL https://raw.githubusercontent.com/chainloop-dev/chainloop/01ad13af08950b7bfbc83569bea207aeb4e1a285/docs/static/install.sh | bash -s
40+
4441
- name: "Checkout code"
4542
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4643
with:
4744
persist-credentials: false
4845

46+
- name: Initialize Attestation
47+
run: |
48+
chainloop attestation init --workflow $CHAINLOOP_WORKFLOW_NAME --project $CHAINLOOP_PROJECT
49+
4950
- name: "Run analysis"
5051
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
5152
with:
@@ -83,13 +84,21 @@ jobs:
8384
with:
8485
sarif_file: results.sarif
8586

86-
chainloop_push:
87-
name: Chainloop Push
88-
uses: chainloop-dev/labs/.github/workflows/chainloop_push.yml@25c77318e739c60e86d3dfe7e864f51c665972dd
89-
needs:
90-
- analysis
91-
secrets:
92-
api_token: ${{ secrets.CHAINLOOP_TOKEN }}
93-
with:
94-
attestation_name: "scorecards"
95-
workflow_name: "chainloop-vault-scorecards"
87+
- name: Attest analysis
88+
run: |
89+
chainloop attestation add --name sarif-results --value results.sarif
90+
91+
- name: Finish and Record Attestation
92+
if: ${{ success() }}
93+
run: |
94+
chainloop attestation push
95+
96+
- name: Mark attestation as failed
97+
if: ${{ failure() }}
98+
run: |
99+
chainloop attestation reset
100+
101+
- name: Mark attestation as cancelled
102+
if: ${{ cancelled() }}
103+
run: |
104+
chainloop attestation reset --trigger cancellation

0 commit comments

Comments
 (0)