Universal CI GitHub Action to add in your workflows.
You can set it up to run on creating or updating pull requests like this complete workflow:
name: Your workflow name
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Run UCI checks
uses: meltingcore/uci@v2You can invoke the action:
- with a specific version (like
v1.1.0) to hardcode to specific release - with a major version (like
v1) to always run the latest release of that major version (i.e.v1.1.0,v1.1.2,v2.0.0, etc.)
The action generates a summary of the checks that were run and displays it at the end of the workflow. In the summary you can check:
The complete UCI configuration

Table with the checks' results

If any check fails the whole action step will fail to make sure that the PR is not merged with failing checks.
Every PR should be first raised as draft one. When that
PR is then created or updated (but not merged) it triggers
a workflow that creates a tag named after the development branch
that is attempted to be merged to the main branch but with
version- as prefix. So if you want to validate any changes before
your PR is ready for review, and your development branch name
is bugfix/something, you can just invoke the uci action with
your branch name as follows:
- name: Run UCI checks
uses: meltingcore/uci@version-bugfix/somethingAfter you are satisfied that your changes work as intended you can then remove the draft status from your PR and merge it upon approval.
Repository used for testing the solution so far is: meltingcore/uci-tests
Currently, contains the following checks:
- Python
- pylint
- bandit
- Terraform
- terraform fmt
- tflint
- trivy
The UCI uses a dotenv configuration file named uci.env that
can be used for customizing the behaviour of the action.
The configuration options are as follows (the values in bold are defaults):
UCI_SUMMARY_CHECKS: [all | failed] - the summary of the checks that should be displayed in the end. If set toallit will display all the checks that were run. If set tofailedit will display only the failed checks.UCI_PYTHON_CHECKS: [true | false] - whether to run Python checks at allUCI_PYTHON_PYLINT_CHECKS: [true | false] - whether to run pylint checksUCI_PYTHON_BANDIT_CHECKS: [true | false] - whether to run bandit checksUCI_TERRAFORM_CHECKS: [true | false] - whether to run Terraform checks at allUCI_TERRAFORM_VERSION: [v1.9.5 | ] - the version of Terraform to use. Should be any valid version string that Terraform supports (with the v prefix).UCI_TERRAFORM_FMT_CHECKS: [true | false] - whether to run terraform fmt checksUCI_TERRAFORM_TFLINT_CHECKS: [true | false] - whether to run tflint checksUCI_TERRAFORM_TRIVY_CHECKS: [true | false] - whether to run trivy checksUCI_TERRAFORM_TRIVY_VERSION: [v0.55.1 | ] - the version of Trivy to use. Should be any valid version string that Trivy supports (with the v prefix).
If you want to override any of them you can place uci.env file in
the root of your repository and set the values you want to override.
Example:
- Turn off python checks
- Use older terraform version
- Show results of all checks
UCI_SUMMARY_CHECKS=all
UCI_PYTHON_CHECKS=false
UCI_TERRAFORM_VERSION=v1.5.0