Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save timnolte/ffcbe3f7cff147d40d4b1e783d0a2cff to your computer and use it in GitHub Desktop.

Select an option

Save timnolte/ffcbe3f7cff147d40d4b1e783d0a2cff to your computer and use it in GitHub Desktop.

Revisions

  1. timnolte revised this gist May 30, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion composer-private-package-github-token.md
    Original file line number Diff line number Diff line change
    @@ -10,11 +10,12 @@ If you're trying to load a private repository with Composer/Laravel, we'll need

    Token Description: (your computer name)
    Scopes:
    [ ] repo
    [X] repo
    [X] repo:status
    [X] repo_deployment
    [X] public_repo
    [X] repo:invite
    [ ] security_events

    3. Click **Generate token**.

  2. timnolte revised this gist May 29, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion composer-private-package-github-token.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ If you're trying to load a private repository with Composer/Laravel, we'll need

    Token Description: (your computer name)
    Scopes:
    [X] repo
    [ ] repo
    [X] repo:status
    [X] repo_deployment
    [X] public_repo
  3. timnolte revised this gist Feb 16, 2024. No changes.
  4. @jeffersonmartin jeffersonmartin revised this gist Aug 11, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions composer-private-package-github-token.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    ### Generate a GitHub Personal Access Token for Private Composer Packages

    If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a `composer install` without entering credentials.

    > If you have used other Github packages from `{my-org}` before, you may be able to skip this step.
  5. @jeffersonmartin jeffersonmartin revised this gist Aug 11, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion composer-private-package-github-token.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a `composer install` without entering credentials.

    > If you have used other packages from `riverbedlab` before, you may be able to skip this step.
    > If you have used other Github packages from `{my-org}` before, you may be able to skip this step.
    1. Visit [https://github.com/settings/tokens](https://github.com/settings/tokens).

  6. @jeffersonmartin jeffersonmartin created this gist Aug 8, 2017.
    35 changes: 35 additions & 0 deletions composer-private-package-github-token.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a `composer install` without entering credentials.

    > If you have used other packages from `riverbedlab` before, you may be able to skip this step.
    1. Visit [https://github.com/settings/tokens](https://github.com/settings/tokens).

    2. Click **Generate new token**.

    Token Description: (your computer name)
    Scopes:
    [X] repo
    [X] repo:status
    [X] repo_deployment
    [X] public_repo
    [X] repo:invite

    3. Click **Generate token**.

    4. Copy the generated string to a safe place, such as a password safe.

    5. Open Terminal and add the github token. Note: The file may be empty.

    # nano ~/.composer/auth.json

    {
    "github-oauth": {
    "github.com": "abc123def456ghi7890jkl987mno654pqr321stu"
    }
    }

    6. Test if the authentication is working by doing a clone.

    cd ~/Sites/
    git clone https://github.com/my-org/my-private-repo
    (You should not be prompted for credentials)