Skip to content

Commit 3c1e588

Browse files
author
R. Tyler Croy
authored
Merge pull request #70 from mramanathan/changeset
Add example of 'sh' step to retrieve changeset
2 parents fe16eb9 + 20751d2 commit 3c1e588

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Synopsis
2+
3+
Demonstrate how to retrieve the changeset associated with a git commit to a Pipeline job.
4+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This should be performed at the point where you've
2+
// checked out your sources on the agent. A 'git' executable
3+
// must be available.
4+
// Most typical, if you're not cloning into a sub directory
5+
// and invoke this in the context of a directory with .git/
6+
// Along with SHA-1 id of the commit, it will be useful to retrieve changeset associated with that commit
7+
// This command results in output indicating several one of these and the affected files:
8+
// Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R)
9+
commitChangeset = sh(returnStdout: true, script: 'git diff-tree --no-commit-id --name-status -r HEAD').trim()

0 commit comments

Comments
 (0)