Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding an initial version of reusable workflow for chainloop. #1

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

danlishka
Copy link
Member

This is how the workflow is going to be used:

  chainloop:
    uses: chainloop-dev/labs/.github/workflows/chainloop.yml@main
    needs: validate-and-generate-reports
    secrets:
      token: ${{ secrets.CHAINLOOP_ROBOT_ACCOUNT }}
      signing_key: ${{ secrets.COSIGN_PRIVATE_KEY }}
      signing_key_password: ${{ secrets.COSIGN_PASSWORD }}

You will need to use upload-artifact action to share all metadata which you want to store in Chainloop.

      - uses: actions/upload-artifact@v3
        with:
          name: reports
          path: reports/*

Finally we expect the .chainloop/config.yml config file to provide information about metadata files to be stored. Example:

attestation:
  - name: sbom-cdx
    path: reports/sbom.cyclonedx.json
  - name: sbom-spdx
    path: reports/sbom.spdx.json
  - name: built-site
    path: reports/build.tar.gz

Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
@migmartri migmartri self-requested a review September 28, 2023 13:02
Copy link
Member

@migmartri migmartri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

Added some comments but approving it

required: false
type: string
secrets:
token:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be more specific about what this is. what about workflow_robot_account ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted something shorter.

curl -sfL https://docs.chainloop.dev/install.sh | bash -s
fi

- name: Download all workflow run artifacts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are github workflow runs artifact correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?


- name: Add all artifacts, reports, and metadata to attestation.
run: |
script=`cat .chainloop/config.yml | yq eval '.attestation[] | "chainloop attestation add --name " + .name + " --value " + .path + "; "'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think we need to have a chainloop directory?

I would potentially prefer just a .chainloop.yml file. That way it's similar to .goreleaser.yaml, .golangcilint.yaml, ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was storing the contract, this config in this folder. I can change it

Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
@danlishka danlishka merged commit 2d8abd4 into main Sep 28, 2023
@danlishka danlishka deleted the reusable_wfs branch September 28, 2023 14:17
danlishka added a commit that referenced this pull request Jul 9, 2024
Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
danlishka added a commit that referenced this pull request Jul 9, 2024
Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
danlishka added a commit that referenced this pull request Jul 9, 2024
* fix: REXML contains a denial of service vulnerability #1

Signed-off-by: Daniel Liszka <daniel@chainloop.dev>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants