이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 1. Adding secrets and variables to GitHub Actions for integration with external tools
Prerequisites
Before you configure GitHub Actions, ensure you have the following:
- Admin access to your GitHub repository and CI/CD settings.
- Container registry credentials for pulling container images from Quay.io, JFrog Artifactory, or Sonatype Nexus.
Authentication details for specific GitHub Actions tasks:
For ACS security tasks:
- ROX Central server endpoint
- ROX API token
For SBOM and artifact signing tasks:
- Cosign signing key password, private key and public key
- Trustification API and issuer URL, client ID, client secret, and supported CycloneDX version
NoteThe credentials and other details are already Base64-encoded, so you do not need to encode them again. You can find these credentials in your
private.envfile, which you created during RHTAP installation.
1.1. Option 1: Adding secrets and variables to GitHub Actions using UI 링크 복사링크가 클립보드에 복사되었습니다!
Procedure
- Log in to GitHub and navigate to your source repository.
- Go to the Settings tab.
- In the left navigation pane, select Secrets and variables, then select Actions.
On the Actions secrets and variables page select the Secrets tab.
- Select New repository secret.
- In the Name field, enter MY_GITHUB_TOKEN.
- In the Secret field, enter the token associated with your GitHub account.
- Select Add secret.
Repeat step 4 to add the required secrets:
Expand Table 1.1. Image registry and GitOps secrets Variable Description IMAGE_REGISTRY_PASSWORDPassword for accessing your container image registry.
GITOPS_AUTH_PASSWORDThe token the system uses to update the GitOps repository for newly built images.
Expand Table 1.2. Secrets required for ACS and SBOM tasks Variable Description ROX_API_TOKENAPI token for accessing the ROX server.
COSIGN_SECRET_PASSWORDPassword for Cosign signing key.
COSIGN_SECRET_KEYPrivate key for Cosign.
TRUSTIFICATION_OIDC_CLIENT_SECRETClient secret used alongside the client ID to authenticate to the Trustification Bombastic API.
On the Actions secrets and variables page switch to the Variables tab.
- Select New repository variable.
- In the Name field, enter IMAGE_REGISTRY_USER.
- In the Value field, enter the username for accessing your container image registry.
- Select Add variable.
Repeat step 6 to add the required variables:
Expand Table 1.3. Image registry variable Variable Description IMAGE_REGISTRY_USERUsername for accessing your container image registry.
Expand Table 1.4. Variables required for ACS and SBOM tasks Variable Description ROX_CENTRAL_ENDPOINTEndpoint for the ROX Central server.
COSIGN_PUBLIC_KEYPublic key for Cosign.
TRUSTIFICATION_BOMBASTIC_API_URLURL for Trustification Bombastic API used in SBOM generation.
TRUSTIFICATION_OIDC_ISSUER_URLOIDC issuer URL used for authentication when interacting with the Trustification Bombastic API.
TRUSTIFICATION_OIDC_CLIENT_IDClient ID for authenticating to the Trustification Bombastic API using OIDC.
TRUSTIFICATION_SUPPORTED_CYCLONEDX_VERSIONSpecifies the CycloneDX SBOM version that is supported and generated by the system.
Optional: Set the Rekor and TUF variables if your CI provider runners do not run on the same cluster as the RHTAP instance.
Expand Table 1.5. Rekor and TUF variables Variable Description REKOR_HOSTURL of your Rekor server.
TUF_MIRRORURL of your TUF service.
Rerun the last pipeline run to verify the secrets are applied correctly.
- Alternatively, switch to you application’s source repository in GitHub, make a minor change, and commit it to trigger a new pipeline run.
1.2. Option 2: Adding secrets and variables to GitHub Actions using CLI 링크 복사링크가 클립보드에 복사되었습니다!
Procedure
Create a project with two files in your preferred text editor, such as Visual Studio Code:
- env_vars.sh
- ghub-set-vars
Update the
env_vars.shfile with the following environment variables:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the
ghub-set-varsfile with the following information:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Load the environment variables into your current shell session:
source env_vars.sh
source env_vars.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make the
ghub-set-varsscript executable, and run it with your repository name to set the variables in your GitHub repository.chmod +x ghub-set-vars ./ghub-set-vars your_repository_name
chmod +x ghub-set-vars ./ghub-set-vars your_repository_nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Rerun the last pipeline run to verify the secrets are applied correctly.
- Alternatively, switch to you application’s source repository in GitHub, make a minor change, and commit it to trigger a new pipeline run.
Revised on 2025-04-30 03:55:48 UTC