Skip to content

Conversation

@caugner
Copy link

@caugner caugner commented Dec 8, 2025

Adds an output for path.

Similar to #1180, which added outputs for ref and commit.

Having the checkout path available as an output is especially useful when using the path input, and avoids having to duplicate the path manually.

Example:

 jobs:
   test:
     runs-on: ubuntu-latest
 
     steps:
       - name: Checkout content
         id: content
         uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
         with:
           repository: mdn/content
           path: mdn/content
           persist-credentials: false

       - name: Run fred
-        working-directory: mdn/content
+        working-directory: ${{ steps.content.outputs.path }}
         env:
-          CONTENT_ROOT: ${{ github.workspace }}/mdn/content/files
+          CONTENT_ROOT: ${{ steps.content.outputs.path }}/files
         run: npm start

@caugner
Copy link
Author

caugner commented Dec 8, 2025

@ericsciple Any chance to get this small tested improvement in one of the next releases? We use this action a lot in MDN workflows, and this output would make our life easier. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant