Skip to content

Add output variable to return path where repository has been cloned #1607

@kenorb

Description

@kenorb

Cloning location sometimes can be confusing and unpredictable and github.workspace not always works in all scenarios, e.g. #785 or when using reusable workflows (workflow call).

So I'm proposing definition of output variable which will return value of path where the repository was cloned.

Example usage:

on:
  workflow_call:
    # Map the workflow outputs to job outputs
    outputs:
      checkout_path:
        value: ${{ jobs.example_job.outputs.checkout_path }}

jobs:
  example_job:
    runs-on: ubuntu-latest
    outputs:
      checkout_path: ${{ steps.checkout_path.outputs.checkout_path }}
    steps:
      - id: checkout_path
        uses: actions/checkout@v4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions