Skip to content

Commit

Permalink
Use commit hash as target ref in provenance
Browse files Browse the repository at this point in the history
Signed-off-by: Joonas Rautiola <[email protected]>
  • Loading branch information
joinemm committed Jun 5, 2024
1 parent ea97b77 commit 9fa93b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ghaf-build-pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pipeline {
extensions: [cleanBeforeCheckout()],
userRemoteConfigs: [[url: params.URL]]
)
script {
env.TARGET_COMMIT = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions ghaf-nightly-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pipeline {
extensions: [cleanBeforeCheckout()],
userRemoteConfigs: [[url: params.URL]]
)
script {
env.TARGET_COMMIT = sh(script: 'git rev-parse HEAD', returnStdout: true).trim()
}
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions provenance-external-params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
# details of the target being built.
target=$(jq -n \
--arg name "$1" \
--arg repository \
"$URL" --arg ref \
"$BRANCH" \
--arg repository "$URL" \
--arg ref "$TARGET_COMMIT" \
'$ARGS.named')

# details of the workflow/pipeline repository
Expand Down

0 comments on commit 9fa93b5

Please sign in to comment.