I’d like to update GitHub status via API. So I tried to use webhook plugin like this:
- name: set-pending
image: plugins/webhook
settings:
urls: https://api.github.com/repos/$CI_REPO_NAME/statuses/$CI_COMMIT_SHA
content_type: application/json
username:
from_secret: GITHUB_USERNAME
password:
from_secret: GITHUB_TOKEN
template: |
{
"status": "pending"
"description": "from hook"
}
It failed because variables are not expanded. Is there any way to use plugins with variables ? If no it would be very nice to have. If it’s hard to use regular bash-like interpolation template syntax would also suffice, something like
urls:
template: |
https://api.github.com/repos/{{ env.CI_REPO_NAME}}/statuses/{{ env.CI_COMMIT_SHA }}