Initialize a new attestation
( ctx context.Context, // Chainloop API token token *dagger.Secret, // Workflow Contract revision, default is the latest // +optional contractRevision string, // Path to the source repository to be attested // +optional repository *dagger.Directory, // Workflow name to be used for the attestation workflowName string, // Project name to be used for the attestation projectName string, // name of an existing contract to attach it to the auto-created workflow // +optional contractName string, // Version of the project to be used for the attestation // +optional projectVersion string, // mark the version as release // +optional release bool, // Control whether this project version is promoted to "latest". // ON_CREATE (default): new versions become latest, existing ones are untouched. // TRUE: force-promote a pre-release version. FALSE: skip promotion entirely. // +optional // +default="ON_CREATE" markLatest MarkLatest, // Github event file for PR detection (when running in Github Actions) // +optional githubEventFile *dagger.File, // Github repository name (owner/repo) // +optional githubRepository string, // Github run ID for the workflow run // +optional githubRunID string, // Github event name (e.g., "pull_request", "pull_request_target") // +optional githubEventName string, // Github source branch name // +optional githubHeadRef string, // Github target branch name // +optional githubBaseRef string, // Github token for API access and commit verification (when running in Github Actions) // +optional githubToken *dagger.Secret, // Gitlab CI indicator (should be "true" when running in Gitlab CI) // +optional gitlabCI string, // Gitlab server URL (e.g., "https://gitlab.com") // +optional gitlabServerURL string, // Gitlab project path (e.g., "group/project") // +optional gitlabProjectPath string, // Gitlab job URL // +optional gitlabJobURL string, // Gitlab pipeline source (should be "merge_request_event" for MRs) // +optional gitlabPipelineSource string, // Gitlab merge request internal ID // +optional gitlabMRIID string, // Gitlab merge request title // +optional gitlabMRTitle string, // Gitlab merge request description // +optional gitlabMRDescription string, // Gitlab source branch name // +optional gitlabMRSourceBranch string, // Gitlab target branch name // +optional gitlabMRTargetBranch string, // Gitlab project URL // +optional gitlabMRProjectURL string, // Gitlab user login // +optional gitlabUserLogin string, // Gitlab job token for API access and commit verification (when running in Gitlab CI) // +optional gitlabJobToken *dagger.Secret, )
| 134 | |
| 135 | // Initialize a new attestation |
| 136 | func (m *Chainloop) Init( |
| 137 | ctx context.Context, |
| 138 | // Chainloop API token |
| 139 | token *dagger.Secret, |
| 140 | // Workflow Contract revision, default is the latest |
| 141 | // +optional |
| 142 | contractRevision string, |
| 143 | // Path to the source repository to be attested |
| 144 | // +optional |
| 145 | repository *dagger.Directory, |
| 146 | // Workflow name to be used for the attestation |
| 147 | workflowName string, |
| 148 | // Project name to be used for the attestation |
| 149 | projectName string, |
| 150 | // name of an existing contract to attach it to the auto-created workflow |
| 151 | // +optional |
| 152 | contractName string, |
| 153 | // Version of the project to be used for the attestation |
| 154 | // +optional |
| 155 | projectVersion string, |
| 156 | // mark the version as release |
| 157 | // +optional |
| 158 | release bool, |
| 159 | // Control whether this project version is promoted to "latest". |
| 160 | // ON_CREATE (default): new versions become latest, existing ones are untouched. |
| 161 | // TRUE: force-promote a pre-release version. FALSE: skip promotion entirely. |
| 162 | // +optional |
| 163 | // +default="ON_CREATE" |
| 164 | markLatest MarkLatest, |
| 165 | // Github event file for PR detection (when running in Github Actions) |
| 166 | // +optional |
| 167 | githubEventFile *dagger.File, |
| 168 | // Github repository name (owner/repo) |
| 169 | // +optional |
| 170 | githubRepository string, |
| 171 | // Github run ID for the workflow run |
| 172 | // +optional |
| 173 | githubRunID string, |
| 174 | // Github event name (e.g., "pull_request", "pull_request_target") |
| 175 | // +optional |
| 176 | githubEventName string, |
| 177 | // Github source branch name |
| 178 | // +optional |
| 179 | githubHeadRef string, |
| 180 | // Github target branch name |
| 181 | // +optional |
| 182 | githubBaseRef string, |
| 183 | // Github token for API access and commit verification (when running in Github Actions) |
| 184 | // +optional |
| 185 | githubToken *dagger.Secret, |
| 186 | // Gitlab CI indicator (should be "true" when running in Gitlab CI) |
| 187 | // +optional |
| 188 | gitlabCI string, |
| 189 | // Gitlab server URL (e.g., "https://gitlab.com") |
| 190 | // +optional |
| 191 | gitlabServerURL string, |
| 192 | // Gitlab project path (e.g., "group/project") |
| 193 | // +optional |