jenkinsci / jenkinsci/last-changes-plugin

Get the name of the latest changed files

Open
#61 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
32
Forks
32
Avg merge
1d 11h
Merged PRs (30d)
1

Description

I need to get the name of the files of the last changes, only the names:
eg
```
-file1.java
-file2.java
```
What I already have tried:
```
stage("last-changes") {
steps {
script {
def publisher = LastChanges.getLastChangesPublisher "PREVIOUS_REVISION", "SIDE", "LINE", true, true, "", "", "", "", ""
publisher.publishLastChanges()
def changes = publisher.getLastChanges()

println('changes:')
println(changes)

println('getEscapedDiff:')
println(changes.getEscapedDiff())

println('getDiff:')
println(changes.getDiff())

for (commit in changes.getCommits()) {
last_changes = commit.getChanges()
println('COMMIT:')
println(commit)
def commitInfo = commit.getCommitInfo()
println('commitInfo:')
println(commitInfo)

println('commitMessage:')

println(commitInfo.getCommitMessage())

println('LastChanges:')
println(last_changes)
}
}
}

}
```
But I didn't find an way to get the name of the files, just the `changes.git Diff()` is resulting something related with what I want, but it shows the `git diff` method too.

There is any way to accomplish this, only the name of the last changed files?

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.