You can make SourceCraft workflows runnable by all organization members. You can grant access to them even if there are no roles in the repository the workflow resides in and no access to its secrets.
The member who runs such a public workflow is able to feed into it the inputs, follow its progress, and get the output data, including artifacts.
You can use this feature, for example, to check tasks in students' test repositories. Another potential use is granting access to some of the CI processes without assigning additional roles to users.
Where settings:shared: true grants the permission to run the workflow to all organization members.
Warning
All public workflow runs are performed by the user who adds the last update to .sourcecraft/ci.yaml in the main branch.
If .sourcecraft/ci.yaml in the main branch was updated directly via git push origin main using a limited-lifetime personal access token (PAT), the workflow will remain public only during that lifetime.
Running a public workflow
Note
This section of the tutorial is for organization members running a public workflow.
You can start a public workflow from within another workflow using the special cr.yandex/sourcecraft/cubes/shared-workflows:latestcube or via the API.
In the input parameters, provide the following:
Slug of the repository containing the workflow.
Organization slug.
Workflow name.
Optionally, the inputs parameters, e.g., the link for cloning the repository you are starting the workflow from.
Optionally, a reference to the execution result: artifacts.
Warning
To get the artifacts from a public workflow, provide the job and cube names and the local artifact path to the environment variables of the cr.yandex/sourcecraft/cubes/shared-workflows:latest cube or in a separate API call.
Add the .sourcecraft/ci.yaml file with the workflow contents to the repository main branch; this file will run the public workflow. Here is an example:
You can only run a public workflow in the repository's main branch and only with the CI/CD configuration from the main branch. Providing head and config_revision in the request body will produce an execution error.