Configuring GitHub Actions
Learn how to configure GitHub Actions for secure CI/CD workflows.
Abstract
Preface Copy linkLink copied to clipboard!
If you are using GitHub Actions for your application, pipeline runs might fail due to missing secrets. Without them, integrations with Quay, JFrog Artifactory, Sonatype Nexus Repository, and Red Hat Advanced Cluster Security (ACS) will not work, breaking security tasks such as vulnerability scanning, image signing, and SBOM generation for compliance.
To prevent this, you need to securely store secrets in GitHub Actions. This guide walks you through the process, ensuring your pipelines run smoothly and securely.
Chapter 1. Configuring GitHub Actions for external integration using the UI Copy linkLink copied to clipboard!
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, JFrog Artifactory, or Sonatype Nexus Repository.
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 RHADS - SSC installation.
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.
- Add values to the Name and Secret fields.
- 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.
- Add values to the Name and Value fields.
- 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 RHADS - SSC 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.
Chapter 2. Configuring GitHub Actions for external integration using the CLI Copy linkLink copied to clipboard!
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, JFrog Artifactory, or Sonatype Nexus Repository.
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 RHADS - SSC installation.
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
$ chmod +x ghub-set-varsCopy to Clipboard Copied! Toggle word wrap Toggle overflow ./ghub-set-vars your_repository_name
$ ./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-11-05 05:27:57 UTC