jenkinsci / jenkinsci/workflow-cps-plugin
[JENKINS-66331] Inaccurate documentation about GIT_COMMIT environment variable
- Dominant language
- Java
- Stars
- 186
- Forks
- 212
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 8
Description
SCM-specific variables such as
GIT_COMMITare not automatically defined as environment variables
However with today's stable Jenkins (2.289.3) and plugins, running this Jenkinsfile:
```
pipeline {
agent any
stages {
stage('Stage') {
steps {
sh 'echo $GIT_COMMIT'
}
}
}
}
```
does print out the Git commit, showing the documentation is inaccurate.
---
Originally reported by
maxb, imported from: Inaccurate documentation about GIT_COMMIT environment variable
Raw content of original issue
SCM-specific variables such as <code>GIT_COMMIT</code> are not automatically defined as environment variables
However with today's stable Jenkins (2.289.3) and plugins, running this Jenkinsfile:
pipeline {
agent any
stages {
stage('Stage') {
steps {
sh 'echo $GIT_COMMIT'
}
}
}
}does print out the Git commit, showing the documentation is inaccurate.
Contributor guide
Research direction
Open src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly and compare its GIT_COMMIT statement with the Jenkinsfile behavior reported in the issue. Update the documentation so it accurately describes the variable's availability; done when the help text no longer contradicts the demonstrated pipeline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100