Overview
If a build doesn't apply contexts, even if you specified the `context` key in your workflow, you can use the CircleCI API v1.1 "Trigger a new Job with a Branch" endpoint to trigger builds.
Identifying the Issue
If the `workflows` section in your configuration shows up as the one below when you view it in the CircleCI UI, you hit this case.
workflows: version: 2 build: jobs: - build: {}
Context is a part of workflow feature, and this is why the context isn't applied to the job.
Solution
You can use the following API endpoints to trigger builds as workflow or pipeline, which will allow you to use the `context` feature:
- https://circleci.com/docs/api/v1/#trigger-a-new-build-by-project-preview
- https://circleci.com/docs/api/v2/#operation/triggerPipeline
Comments
Article is closed for comments.