Skip to content

v4.0.2: Additional optional steps to pass commands in each job before or after its execution

Choose a tag to compare

@aakashdeshpandesg aakashdeshpandesg released this 19 Dec 09:49
· 90 commits to master since this release
beef758

What:
Introduced Additional Optional Steps in v4.0.2: Now, users have the flexibility to include custom commands before or after the execution of each job.

Why:
To cater to project-specific needs, this update allows the injection of supplementary commands in jobs, either before or after their execution.

Info:
These extra commands can be specified through dedicated arguments for each job, depending on whether the command should be executed before or after the job. Here are examples of supported arguments for specific jobs:

Danger Job:
danger_before_step_command: string (default: "")
danger_after_step_command: string (default: "")

Semgrep Job:
semgrep_before_step_command: string (default: "")
semgrep_after_step_command: string (default: "")

SBOM Job:
sbom_before_step_command: string (default: "")
sbom_after_step_command: string (default: "")

OSv Job:
osv_before_step_command: string (default: "")
osv_after_step_command: string (default: "")

License Scan Job:
licensescan_before_step_command: string (default: "")
licensescan_after_step_command: string (default: "")

Gitleaks Job:
gitleaks_before_step_command: string (default: "")
gitleaks_after_step_command: string (default: "")

PR Agent Job:
pr_agent_before_step_command: string (default: "")
pr_agent_after_step_command: string (default: "")

Caching Job:
caching_before_step_command: string (default: "")
caching_after_step_command: string (default: "")

Docker Job:
docker_before_step_command: string (default: "")
docker_after_step_command: string (default: "")

Lint Job:
lint_before_step_command: string (default: "")
lint_after_step_command: string (default: "")

Build Job:
build_before_step_command: string (default: "")
build_after_step_command: string (default: "")

How to Use in Workflow:
In the workflow file, any of the above-mentioned arguments can be utilised based on the job's requirements. Commands can be passed using the specified arguments.
For example, to pass a command in the build job before its actual execution:

    name: studiographene-ci
    
    on:
      pull_request: {}
      workflow_dispatch:
    
    jobs:
      call-workflow:
        uses: studiographene/nodejs-ci/.github/workflows/ci.yml@master
        with:
          project_name: microservice-boilerplate
          build_before_step_command: command to pass
        secrets: inherit
        permissions: write-all