Skip to content

Commit dbdf390

Browse files
committed
Add path output
1 parent 8e8c483 commit dbdf390

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ jobs:
334334
run: |
335335
echo "Commit: ${{ steps.checkout.outputs.commit }}"
336336
echo "Ref: ${{ steps.checkout.outputs.ref }}"
337+
echo "Path: ${{ steps.checkout.outputs.path }}"
337338
338339
if [ "${{ steps.checkout.outputs.ref }}" != "test-data/v2/basic" ]; then
339340
echo "Expected ref to be test-data/v2/basic"
@@ -344,3 +345,8 @@ jobs:
344345
echo "Expected commit to be 82f71901cf8c021332310dcc8cdba84c4193ff5d"
345346
exit 1
346347
fi
348+
349+
if [[ "${{ steps.checkout.outputs.path }}" != *"/cloned-using-local-action" ]]; then
350+
echo "Expected path to end with /cloned-using-local-action"
351+
exit 1
352+
fi

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ outputs:
103103
description: 'The branch, tag or SHA that was checked out'
104104
commit:
105105
description: 'The commit SHA that was checked out'
106+
path:
107+
description: 'The absolute path that was checked out to'
106108
runs:
107109
using: node24
108110
main: dist/index.js

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,6 +2135,7 @@ function run() {
21352135
// Get sources
21362136
yield gitSourceProvider.getSource(sourceSettings);
21372137
core.setOutput('ref', sourceSettings.ref);
2138+
core.setOutput('path', sourceSettings.repositoryPath);
21382139
}
21392140
finally {
21402141
// Unregister problem matcher

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async function run(): Promise<void> {
2020
// Get sources
2121
await gitSourceProvider.getSource(sourceSettings)
2222
core.setOutput('ref', sourceSettings.ref)
23+
core.setOutput('path', sourceSettings.repositoryPath)
2324
} finally {
2425
// Unregister problem matcher
2526
coreCommand.issueCommand('remove-matcher', {owner: 'checkout-git'}, '')

0 commit comments

Comments
 (0)