{"id":13577398,"url":"https://github.com/daspn/private-actions-checkout","last_synced_at":"2025-03-29T19:01:36.281Z","repository":{"id":42691055,"uuid":"268608000","full_name":"daspn/private-actions-checkout","owner":"daspn","description":"GitHub Action to make custom private actions easily available to any workflow","archived":false,"fork":false,"pushed_at":"2025-02-25T04:16:12.000Z","size":396,"stargazers_count":81,"open_issues_count":4,"forks_count":25,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T18:05:29.293Z","etag":null,"topics":["github-actions","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daspn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-01T19:02:46.000Z","updated_at":"2025-03-10T13:26:54.000Z","dependencies_parsed_at":"2023-02-08T17:01:21.336Z","dependency_job_id":"6e383a86-dd04-41d9-b837-d96d5a9658da","html_url":"https://github.com/daspn/private-actions-checkout","commit_stats":{"total_commits":40,"total_committers":7,"mean_commits":5.714285714285714,"dds":0.65,"last_synced_commit":"501f5c0ffba59a3ab25c4d1d96c309caa572415c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daspn%2Fprivate-actions-checkout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daspn%2Fprivate-actions-checkout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daspn%2Fprivate-actions-checkout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daspn%2Fprivate-actions-checkout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daspn","download_url":"https://codeload.github.com/daspn/private-actions-checkout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246230504,"owners_count":20744347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","javascript"],"created_at":"2024-08-01T15:01:21.101Z","updated_at":"2025-03-29T19:01:36.228Z","avatar_url":"https://github.com/daspn.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![SSH Tests](https://github.com/daspn/private-actions-checkout/actions/workflows/tests-ssh.yml/badge.svg)](https://github.com/daspn/private-actions-checkout/actions/workflows/tests-ssh.yml)\n[![GitHub App tests](https://github.com/daspn/private-actions-checkout/actions/workflows/tests-gh-app.yml/badge.svg)](https://github.com/daspn/private-actions-checkout/actions/workflows/tests-gh-app.yml)\n\n# private-actions-checkout\n\nSimplifies using custom private actions (and promotes code reuse) by looping through a list of repositories and checking \nthem out into the job's workspace. Supports using GitHub Apps or multiple SSH keys.\n\nOptionally configures git to allow subsequent steps to provide authenticated access private repos.\n\nThis action is tested on `ubuntu-latest` and `macos-latest`. No Windows support yet.\n\n## Usage\n\n### Pre-requisites\nCreate a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflows) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).\n\n### Supported authentications\nTo checkout private repositories we need a supported authentication accepted by the Git protocol. This action supports\nGitHub Apps and SSH keys.\n\nFor enterprise environments we recommend using a GitHub app per organization with 1 installation as it doesn't require having a machine account.\n\n### Inputs\n\n* `actions_list` - **OPTIONAL**: List of private actions to checkout. Must be a JSON array and each entry must match the format owner/repo@ref.  May be an empty array if no actions are required.\n* `checkout_base_path` - **OPTIONAL**: Where to checkout the custom actions. It uses `./.github/actions` as default path\n* `return_app_token` - **OPTIONAL**: If set to `true` then an output variable called `app-token` will be set that can be used for basic auth to github by subsequent steps (only works with Github Apps as the authentication method)\n* `configure_git` - **OPTIONAL**: If set to `true` then `git config` is executed to grant subsequent steps access to other private repos using the ssh or Github App token.\n\nIf you want to use **GitHub Apps** (recommended):\n* `app_id`: the GitHub App id obtained when you [create a GitHub app](https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app)\n* `app_private_key`: the [GitHub App private key](https://docs.github.com/en/free-pro-team@latest/developers/apps/authenticating-with-github-apps#generating-a-private-key) generated for an app with permissions on the repositories\n\n\u003e We support the key being plain and base64 encoded. To encode the private key you can use the following command: `cat key.pem | base64 | tr -d \\\\n \u0026\u0026 echo`\n\nIf you want to use **SSH keys**:\n* `ssh_private_key` - **OPTIONAL**: If provided, configures the `ssh-agent` with the given private key. If not provided the code assumes that valid SSH credentials are available to the `git` executable.  If `configure_git` is enabled then the agent will be left running until the end of the job. \n\n## GitHub app requisites\nIf you want to use this action with a GitHub app you will need to setup some permissions.\nFollow the [create GitHub app guide](https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app) and check:\n- **Repository permissions**\n  - Contents: read\n\nOnce it is created, [install the GitHub app](https://docs.github.com/en/free-pro-team@latest/developers/apps/installing-github-apps) in your account or organization and grant access to the repositories that contain the actions you want to\ncheckout (or all if you are not concerned the app has wide access in the account or org).\n\n## Example workflows\n### GitHub app\n```yaml\nname: 'Example workflow'\n\non: push\n\njobs:\n  example:\n    runs-on: ubuntu-18.04\n\n    steps:\n    - uses: actions/checkout@v2\n\n    - name: Private actions checkout\n      uses: daspn/private-actions-checkout@v2\n      with:\n        actions_list: '[\"githubuser/my-private-action-1@v1\", \"githubuser/my-private-action-2@v1\"]'\n        checkout_base_path: ./.github/actions\n        app_id: ${{ secrets.APP_ID }}\n        app_private_key: ${{ secrets.APP_PRIVATE_KEY }}\n\n    - name: Validation\n      run: |\n        ls -lR ./.github/actions\n\n    # the custom private action will be available on the job's workspace\n    - name: 'Using custom private action 1'\n      uses: ./.github/actions/my-private-action-1\n      with:\n        some_arg: test\n\n    - name: 'Using custom private action 2'\n      uses: ./.github/actions/my-private-action-2\n```\n\n### SSH\n**Single SSH key:**\n```yaml\nname: 'Example workflow'\n\non: push\n\njobs:\n  example:\n    runs-on: ubuntu-18.04\n\n    steps:\n    - uses: actions/checkout@v2\n\n    - name: Private actions checkout\n      uses: daspn/private-actions-checkout@v2\n      with:\n        actions_list: '[\"githubuser/my-private-action-1@v1\", \"githubuser/my-private-action-2@v1\"]'\n        checkout_base_path: ./.github/actions\n        ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}\n\n    - name: Validation\n      run: |\n        ls -lR ./.github/actions\n\n    # the custom private action will be available on the job's workspace\n    - name: 'Using custom private action 1'\n      uses: ./.github/actions/my-private-action-1\n      with:\n        some_arg: test\n\n    - name: 'Using custom private action 2'\n      uses: ./.github/actions/my-private-action-2\n```\n\n**Multiple SSH keys workflow example:**\n```yaml\nname: 'Multiple SSH Keys workflow example'\n\non: push\n\njobs:\n  example:\n    runs-on: ubuntu-18.04\n\n    steps:\n    - uses: actions/checkout@v2\n\n    - name: Checking out private actions from github_user\n      uses: daspn/private-actions-checkout@v2\n      with:\n        actions_list: '[\"github_user/my-private-action-1@v1\", \"github_user/my-private-action-2@v1\"]'\n        checkout_base_path: ./.github/actions\n        ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY_1 }}\n\n    - name: Checking out private actions from another_github_user\n      uses: daspn/private-actions-checkout@v2\n      with:\n        actions_list: '[\"another_github_user/my-private-action-3@v1\", \"another_github_user/my-private-action-4@v1\"]'\n        checkout_base_path: ./.github/actions\n        ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY_2 }}\n\n    - name: Validation\n      run: |\n        ls -lR ./.github/actions\n\n    # the custom private action will be available on the job's workspace\n    - name: 'Using custom private action 1'\n      uses: ./.github/actions/my-private-action-1\n      with:\n        some_arg: test\n\n    - name: 'Using custom private action 4'\n      uses: ./.github/actions/my-private-action-4\n```\n\n**No SSH Key example workflow:**\n```yaml\nname: 'No SSH Key example workflow'\n\non: push\n\njobs:\n  example:\n    runs-on: ubuntu-18.04\n\n    steps:\n    - uses: actions/checkout@v2\n\n    # setting up the SSH agent using a third party action\n    - uses: webfactory/ssh-agent@v0.2.0\n      with:\n        ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}\n\n    # as no SSH key is provided the action will assume valid SSH credentials are available\n    - name: Private actions checkout\n      uses: daspn/private-actions-checkout@v2\n      with:\n        actions_list: '[\"githubuser/my-private-action-1@v1\", \"githubuser/my-private-action-2@v1\"]'\n        checkout_base_path: ./.github/actions\n\n    - name: Validation\n      run: |\n        ls -lR ./.github/actions\n\n    # the custom private action will be available on the job's workspace\n    - name: 'Using custom private action 1'\n      uses: ./.github/actions/my-private-action-1\n      with:\n        some_arg: test\n\n    - name: 'Using custom private action 2'\n      uses: ./.github/actions/my-private-action-2\n```\n\nGitHub App authorizing a Go application to fetch other private dependencies:\n```yaml\nname: 'Example workflow'\n\non: push\n\njobs:\n  example:\n    runs-on: ubuntu-18.04\n\n    steps:\n    - uses: actions/checkout@v2\n\n    - name: Private actions checkout\n      uses: daspn/private-actions-checkout@v2\n      with:\n        app_id: ${{ secrets.APP_ID }}\n        app_private_key: ${{ secrets.APP_PRIVATE_KEY }}\n        configure_git: true\n\n    - name: Set up Go\n      uses: actions/setup-go@v2\n      with:\n        go-version: 1.15\n\n    # Go build will be able to access other private repos authorized to the app\n    - name: Build\n      run: go build -v .\n```\n\n\n### How to build\n\n#### Local environment setup\n\nTo build this code, `Node.js 12.x` is [required](https://nodejs.org/en/download/current/).\n\nAfter installing `Node.js 12.x`, install the NPM package `zeit/ncc` by running:\n\n```shell\nnpm i -g @zeit/ncc\n```\n\n## Building the code\n\n```shell\nnpm i\nnpm run build\n```\n\nThis will update the `dist/index.js` and `dist/cleanup/index.js` files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaspn%2Fprivate-actions-checkout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaspn%2Fprivate-actions-checkout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaspn%2Fprivate-actions-checkout/lists"}