diff options
author | Oliver Kästner <git@oliver-kaestner.de> | 2024-10-12 21:31:35 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-14 21:44:38 +0100 |
commit | aa546ea0c316116d1f6f34f729a9e23f24322e0e (patch) | |
tree | 4effe6a80e33d43ebbe6d06430d22e5194cd298d | |
parent | 7637bd0b9c2d8016051629e96fb526dd6fa76e54 (diff) | |
download | poky-aa546ea0c316116d1f6f34f729a9e23f24322e0e.tar.gz |
bitbake: fetch2: add GitHub Codespaces support
GitHub Codespaces allow users to use GitHub-hosted pre-configured Docker
containers to work on GitHub repositories in VS Code within the browser
or using a locally running instance of VS Code [1].
Users can define access permissions for Codespaces containers, allowing
them to clone or work with other private repositories [2].
To do this, a git credential helper is injected into the container at
/.codespaces/bin/gitcredential_github.sh, which contains the following
lines:
#!/bin/sh
echo protocol=https
echo host=github.com
echo path=
echo username=PersonalAccessToken
echo password=$GITHUB_TOKEN
The `GITHUB_TOKEN` environment variable is automatically set when the
Codespaces container is created. If authorized by the user, it has the
specified permissions. It is thus required to be able to fetch private
git repos from a Codespace container, so add it to `FETCH_EXPORT_VARS`
to make it available for invocations of git.
[1] https://docs.github.com/en/codespaces/overview
[2] https://docs.github.com/en/codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces
(Bitbake rev: 71ca83bdd541f70737a3a85f05e40c222611af2f)
Signed-off-by: Oliver Kästner <git@oliver-kaestner.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index add742bfad..7ee12f4524 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -885,6 +885,7 @@ FETCH_EXPORT_VARS = ['HOME', 'PATH', | |||
885 | 'AWS_SESSION_TOKEN', | 885 | 'AWS_SESSION_TOKEN', |
886 | 'GIT_CACHE_PATH', | 886 | 'GIT_CACHE_PATH', |
887 | 'REMOTE_CONTAINERS_IPC', | 887 | 'REMOTE_CONTAINERS_IPC', |
888 | 'GITHUB_TOKEN', | ||
888 | 'SSL_CERT_DIR'] | 889 | 'SSL_CERT_DIR'] |
889 | 890 | ||
890 | def get_fetcher_environment(d): | 891 | def get_fetcher_environment(d): |