This directory contains reusable composite actions that can be used across workflows.
✅ All actions are safe for public repositories - No secrets, credentials, or sensitive data are hardcoded in any action.
- All secrets are passed as inputs from workflows
- Secrets are managed at the workflow level, not in actions
- Actions use authenticated contexts (e.g.,
gcloud auth print-access-token) that are set up in workflows - No API keys, passwords, or tokens are embedded in action code
These actions should be copied to your organization's .github repository at:
.github/actions/<action-name>/action.yml
Note: These actions can be safely stored in a public .github repository and used by private repositories. All sensitive data (secrets, tokens, credentials) must be passed from the calling workflow.
- detect-module - Detects Maven module path based on pattern and changed files
- generate-version - Generates version number based on branch and event type
- maven-version - Updates or resets Maven project version
- maven-settings - Configures Maven settings.xml for GCP Artifact Registry
- maven-build - Builds Maven project with optional profiles
- maven-deploy - Authenticates and deploys Maven artifacts to GCP Artifact Registry
- docker-build - Builds and publishes Docker image using Maven
- git-tag - Creates and pushes a Git tag for releases
Once these actions are in your organization's .github repository, reference them like:
- name: Detect module
uses: <org-name>/.github/.github/actions/detect-module@main
with:
module_path: ${{ inputs.module_path }}
module_pattern: ${{ inputs.module_pattern }}Or if using locally in the same repository:
- name: Detect module
uses: ./.github/actions/detect-module
with:
module_path: ${{ inputs.module_path }}
module_pattern: ${{ inputs.module_pattern }}To move these actions to organization-level:
-
Copy each action directory to your org
.githubrepo:cp -r .github/actions/* <org-repo>/.github/actions/
-
Update workflow files to reference org-level actions:
# Change from: uses: ./.github/actions/detect-module # To: uses: <org-name>/.github/.github/actions/detect-module@main
-
Commit and push to the org repository
-
GCP Authentication: The
maven-deployaction usesgcloud auth print-access-tokenwhich retrieves a token from the authenticated gcloud session. The GCP service account key is provided as a secret in the workflow (viagoogle-github-actions/auth@v2), not in the action itself. -
GitHub Token: The
git-tagaction requires a GitHub token, which must be passed as an input from the workflow. The workflow should usesecrets.GITHUB_TOKENor a custom token secret. -
Maven/Docker Registry URLs: All registry URLs and repository names are passed as inputs, never hardcoded.
- ✅ Store these actions in a public
.githubrepository - ✅ Pass all secrets from the calling workflow
- ✅ Use GitHub secrets for sensitive data
- ✅ Never commit secrets to any repository
- ❌ Don't hardcode credentials in actions
- ❌ Don't log or expose secrets in action outputs
- Reusability: Use the same actions across all repositories
- Maintainability: Update logic in one place
- Consistency: Ensure all repos use the same build process
- Testability: Test actions independently
- Security: Safe for public repositories - no secrets embedded