Configuring Repository Variables and Secrets on GitHub¶
In order to customize and secure your project environment, you need to set up variables and secrets within your GitHub repository. These are accessible in the repository settings under the Settings
tab. Follow these steps to add the necessary variables:
Access Repository Settings:
Navigate to your GitHub repository page.
Click on the
Settings
tab located at the top of the page.
Navigate to Secrets Section:
First, open the
Settings
tab of your project or repository.In the left sidebar, scroll down to find the
Secrets and Variables
section.Click on
Actions
within this section.Then, select
Variables
.To add new repository variables, click on
New Repository Variable
.
Set Up Variables:
Project Name: Define the
DOCS_PROJECT_NAME
with the name of your project.Author Name: For
Name
, inputDOCS_AUTHOR
. ForValue
, enter the author’s full name.Author Email: Add a new secret with
Name
asDOCS_EMAIL
and the value as the author’s email address.Module: Use
DOCS_MODULE
for theName
and the specific module name for theValue
. Note that this should be the name of the repository.Submodule: If your project has submodules, use
DOCS_SUBMODULE
for theName
and the specific submodule name for theValue
. This should also correspond to the name of the repository. For example, for a repository namedgcpds.docs
,DOCS_MODULE
would begcpds
andDOCS_SUBMODULE
would bedocs
.
Save Each Variable:
After entering the name and value for each variable, click the
Add secret
button to save it.
Review and Maintain Secrets:
Make sure to review your secrets and variables regularly.
Update them as necessary to keep your environment secure and up to date.
Remember that secrets are encrypted environment variables created in your repository settings. They are not passed to workflows that are triggered by a pull request from a fork.