From dbdf390b9df86be0ae194023365148d91d2b05a9 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Mon, 8 Dec 2025 15:30:47 +0100 Subject: [PATCH] Add path output --- .github/workflows/test.yml | 6 ++++++ action.yml | 2 ++ dist/index.js | 1 + src/main.ts | 1 + 4 files changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe2539f5a..7cab2edb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -334,6 +334,7 @@ jobs: run: | echo "Commit: ${{ steps.checkout.outputs.commit }}" echo "Ref: ${{ steps.checkout.outputs.ref }}" + echo "Path: ${{ steps.checkout.outputs.path }}" if [ "${{ steps.checkout.outputs.ref }}" != "test-data/v2/basic" ]; then echo "Expected ref to be test-data/v2/basic" @@ -344,3 +345,8 @@ jobs: echo "Expected commit to be 82f71901cf8c021332310dcc8cdba84c4193ff5d" exit 1 fi + + if [[ "${{ steps.checkout.outputs.path }}" != *"/cloned-using-local-action" ]]; then + echo "Expected path to end with /cloned-using-local-action" + exit 1 + fi diff --git a/action.yml b/action.yml index 767c41649..21f7d2401 100644 --- a/action.yml +++ b/action.yml @@ -103,6 +103,8 @@ outputs: description: 'The branch, tag or SHA that was checked out' commit: description: 'The commit SHA that was checked out' + path: + description: 'The absolute path that was checked out to' runs: using: node24 main: dist/index.js diff --git a/dist/index.js b/dist/index.js index b9b34d342..d6bfe622f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2135,6 +2135,7 @@ function run() { // Get sources yield gitSourceProvider.getSource(sourceSettings); core.setOutput('ref', sourceSettings.ref); + core.setOutput('path', sourceSettings.repositoryPath); } finally { // Unregister problem matcher diff --git a/src/main.ts b/src/main.ts index 0684c6f5e..6c8f2e9b6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,6 +20,7 @@ async function run(): Promise { // Get sources await gitSourceProvider.getSource(sourceSettings) core.setOutput('ref', sourceSettings.ref) + core.setOutput('path', sourceSettings.repositoryPath) } finally { // Unregister problem matcher coreCommand.issueCommand('remove-matcher', {owner: 'checkout-git'}, '')