This guide will help you set up and use the shared GitHub Actions from this repository.
- A GitHub repository where you want to use these workflows
- Appropriate permissions to create workflows in your repository
- For Salesforce Code Analyzer: A Salesforce project with code to analyze
- Go to your repository settings
- Navigate to Actions → General
- Ensure "Allow all actions and reusable workflows" is selected
In your repository, create a new file at .github/workflows/code-analysis.yml
Add the following content to your workflow file:
name: Code Analysis
on:
pull_request:
jobs:
analyze:
uses: Gforce-Innovation-Kft/shared-github-actions/.github/workflows/reusable-sf-code-analyze.yml@v2
permissions:
pull-requests: write
contents: read
actions: readThe tag and the path move together. reusable-sf-code-analyze.yml is the v2 name.
At @v1 the same workflow is salesforce-code-analyzer.yml — so
reusable-sf-code-analyze.yml@v1 does not resolve, and neither does
salesforce-code-analyzer.yml@v2. Pin @v2 for new callers; the full rename mapping is
in ADR 0002.
Commit the workflow file and push it to your repository. The workflow will run automatically on the next pull request.
If your repository is public, workflows can be used immediately by referencing them.
- Go to repository Settings → Actions → General
- Under "Access", select "Accessible from repositories in the organization"
- Save changes
For private repositories:
- The calling repository must be in the same organization
- Set proper access permissions in repository settings
uses: Gforce-Innovation-Kft/shared-github-actions/.github/workflows/reusable-sf-code-analyze.yml@v2Pros: Fixes and non-breaking features arrive automatically; breaking changes never do (they bump the major) Cons: The tag moves — behavior can change between runs within the major
uses: Gforce-Innovation-Kft/shared-github-actions/.github/workflows/reusable-sf-code-analyze.yml@v2.0.0Pros: Immutable, fully predictable behavior Cons: Need to manually update to get fixes and new features
Development and testing only — unreleased changes land here and may break at
any time. Never use @main in production callers.
Push a semver tag from main; the release workflow
creates the GitHub Release and force-moves the major tag (v2) automatically:
git checkout main && git pull
git tag v2.1.0
git push origin v2.1.0A major bump has a manual step first — the reusable workflows' own self-references must be re-pinned to the new tag before tagging. Full procedure: CONTRIBUTING.md.
Before using a workflow in production:
- Create a test repository
- Add the workflow reference
- Create a test pull request
- Verify the workflow runs correctly
- Check the generated artifacts and outputs
- Verify the repository path is correct
- Check that the workflow file exists at the specified path
- Ensure the branch or tag exists
- Verify repository access settings
- Check that required permissions are granted in the calling workflow
- For organizations, verify the repository is allowed to use actions from other repos
- Check that all required inputs are provided
- Verify the workflow syntax is correct
- Review GitHub Actions logs for specific error messages
For issues or questions:
- Check the README.md for usage examples
- Review workflow logs for error details
- Open an issue in this repository