jenkinsci / jenkinsci/generic-webhook-trigger-plugin

Variables expansion in the payload

Open
#363 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
427
Forks
169
Avg merge
23m
Merged PRs (30d)
1

Description

### Jenkins and plugins versions report

In one of my jobs I have this with credentials:
```
credentialsBinding {
string('BOT_TOKEN', 'bot-token')
usernamePassword('OTHER_CREDENTIALS', 'other-credentials')
}
```

Then I have this with Generic Webhook Trigger:
```
genericVariable {
key("COMMENT_TEXT")
value("\$.comment.text")
}
```

If in the comment text I have something like:
```
Use the variable ${BOT_TOKEN} and ${OTHER_CREDENTIALS}.
```

Then inside of the shell command I have
```
echo "${COMMENT_TEXT}"
```

The output will be:
```
Use the variable **** and ****.
```

I have this job working as a webhook for Bitbucket, so when someone adds a comment to a PR a message is sent in Mattermost to the user. Then the person will receive not the `***`, they are receiving the actual credentials, but they were supposed to receive the literal `Use the variable ${BOT_TOKEN} and ${OTHER_CREDENTIALS}.`.

I believe the plugin is doing the expansion or I'm missing some configuration.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.