-
Notifications
You must be signed in to change notification settings - Fork 2
chore: update scripts to initialize with project_name #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,10 @@ on: | |
jobs: | ||
onboard_workflow: | ||
name: Onboard Chainloop Workflow | ||
uses: chainloop-dev/labs/.github/workflows/chainloop_onboard.yml@4173e015dbd5dc2a8802555c268da63d57bbe576 | ||
uses: chainloop-dev/labs/.github/workflows/chainloop_onboard.yml@main | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
with: | ||
project: ${{ inputs.workflow_project }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure how this ever worked. Did I miss anything cc/ @javirln |
||
project: ${{ inputs.project }} | ||
workflow_name: ${{ inputs.workflow_name }} | ||
# Pass parent workflow secrets to the child workflow | ||
secrets: inherit | ||
|
@@ -46,6 +46,7 @@ jobs: | |
if: github.event_name == 'release' && github.event.action == 'published' | ||
env: | ||
CHAINLOOP_WORKFLOW_NAME: ${{ needs.onboard_workflow.outputs.workflow_name }} | ||
CHAINLOOP_PROJECT_NAME: ${{ needs.onboard_workflow.outputs.project_name }} | ||
CHAINLOOP_TOKEN: ${{ secrets.api_token }} | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
|
@@ -58,14 +59,14 @@ jobs: | |
|
||
- name: Initialize Attestation | ||
run: | | ||
chainloop attestation init --workflow-name ${CHAINLOOP_WORKFLOW_NAME} | ||
chainloop attestation init --workflow-name ${CHAINLOOP_WORKFLOW_NAME} --project ${CHAINLOOP_PROJECT_NAME} | ||
|
||
- name: Attest all assets | ||
run: | | ||
# gh release download raises an error if there are not assets on the release | ||
# that makes the workflow fail, so we use `|| true` to avoid that | ||
gh release download ${{github.ref_name}} -D /tmp/github-release || true | ||
|
||
for entry in $(ls /tmp/github-release); do | ||
chainloop attestation add --value "/tmp/github-release/$entry" | ||
done | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -674,9 +674,13 @@ chainloop_attestation_init() { | |
fi | ||
WF_NAME_VALUE="" | ||
if [ -n "${CHAINLOOP_WORKFLOW_NAME}" ]; then | ||
WF_NAME_VALUE="--workflow-name ${CHAINLOOP_WORKFLOW_NAME}" | ||
WF_NAME_VALUE="--workflow ${CHAINLOOP_WORKFLOW_NAME}" | ||
fi | ||
r=$(chainloop attestation init -f --remote-state --output json $CR_VALUE $WF_NAME_VALUE) | ||
PROJECT_NAME_VALUE="" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danlishka I might need your help here. I am trying to figure out how the push works. I think it uses some kind of cache, but I guess that now we will need to update the cache to also take into account the project name, but I am struggling to find that. No rush There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh no, the cache is unique within the run, ok. I am wondering then why we are passing the workflow name here |
||
if [ -n "${CHAINLOOP_PROJECT_NAME}" ]; then | ||
PROJECT_NAME_VALUE="--project ${CHAINLOOP_PROJECT_NAME}" | ||
fi | ||
r=$(chainloop attestation init -f --remote-state --output json $CR_VALUE $WF_NAME_VALUE $PROJECT_NAME_VALUE) | ||
if [ $? -ne 0 ]; then | ||
log_error "Chainloop initialization failed: $r" | ||
return 1 | ||
|
Uh oh!
There was an error while loading. Please reload this page.