Cuando GitLab Pipeline pasa → pasa al estado
Deberá añadir un webhook a su GitLab repositorio. Consulte este artículo para saber cómo hacerlo.
JavaScript para la acción:
const branch = args.body.object_attributes.ref;
// Branch is smth like ___PROTECTED_1___
const match = branch.match(/^us(\d+)/);
if (match && isFinite(match[1])) {
const entityId = parseInt(match[1]);
return {
command: 'targetprocess:MoveToState',
payload: {
resourceType: 'UserStory',
resourceId: entityId,
stateKind: 'Final'
}
}
}