mirror of
https://github.com/actions/checkout.git
synced 2025-12-09 14:15:22 +00:00
Add path output
This commit is contained in:
parent
8e8c483db8
commit
dbdf390b9d
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -334,6 +334,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Commit: ${{ steps.checkout.outputs.commit }}"
|
echo "Commit: ${{ steps.checkout.outputs.commit }}"
|
||||||
echo "Ref: ${{ steps.checkout.outputs.ref }}"
|
echo "Ref: ${{ steps.checkout.outputs.ref }}"
|
||||||
|
echo "Path: ${{ steps.checkout.outputs.path }}"
|
||||||
|
|
||||||
if [ "${{ steps.checkout.outputs.ref }}" != "test-data/v2/basic" ]; then
|
if [ "${{ steps.checkout.outputs.ref }}" != "test-data/v2/basic" ]; then
|
||||||
echo "Expected ref to be test-data/v2/basic"
|
echo "Expected ref to be test-data/v2/basic"
|
||||||
@ -344,3 +345,8 @@ jobs:
|
|||||||
echo "Expected commit to be 82f71901cf8c021332310dcc8cdba84c4193ff5d"
|
echo "Expected commit to be 82f71901cf8c021332310dcc8cdba84c4193ff5d"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ steps.checkout.outputs.path }}" != *"/cloned-using-local-action" ]]; then
|
||||||
|
echo "Expected path to end with /cloned-using-local-action"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@ -103,6 +103,8 @@ outputs:
|
|||||||
description: 'The branch, tag or SHA that was checked out'
|
description: 'The branch, tag or SHA that was checked out'
|
||||||
commit:
|
commit:
|
||||||
description: 'The commit SHA that was checked out'
|
description: 'The commit SHA that was checked out'
|
||||||
|
path:
|
||||||
|
description: 'The absolute path that was checked out to'
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node24
|
||||||
main: dist/index.js
|
main: dist/index.js
|
||||||
|
|||||||
1
dist/index.js
vendored
1
dist/index.js
vendored
@ -2135,6 +2135,7 @@ function run() {
|
|||||||
// Get sources
|
// Get sources
|
||||||
yield gitSourceProvider.getSource(sourceSettings);
|
yield gitSourceProvider.getSource(sourceSettings);
|
||||||
core.setOutput('ref', sourceSettings.ref);
|
core.setOutput('ref', sourceSettings.ref);
|
||||||
|
core.setOutput('path', sourceSettings.repositoryPath);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
// Unregister problem matcher
|
// Unregister problem matcher
|
||||||
|
|||||||
@ -20,6 +20,7 @@ async function run(): Promise<void> {
|
|||||||
// Get sources
|
// Get sources
|
||||||
await gitSourceProvider.getSource(sourceSettings)
|
await gitSourceProvider.getSource(sourceSettings)
|
||||||
core.setOutput('ref', sourceSettings.ref)
|
core.setOutput('ref', sourceSettings.ref)
|
||||||
|
core.setOutput('path', sourceSettings.repositoryPath)
|
||||||
} finally {
|
} finally {
|
||||||
// Unregister problem matcher
|
// Unregister problem matcher
|
||||||
coreCommand.issueCommand('remove-matcher', {owner: 'checkout-git'}, '')
|
coreCommand.issueCommand('remove-matcher', {owner: 'checkout-git'}, '')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user