Skip to content

Add language to a rule #194

Add language to a rule

Add language to a rule #194

Workflow file for this run

name: Add language to a rule
# Workflow runs when manually triggered using the UI or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
rule:
description: 'ID of an existing rule (e.g., S1234).'
required: true
language:
description: 'Language to be added to the rule, (e.g., cfamily)'
required: true
jobs:
add_language_to_rule:
runs-on: ubuntu-latest
permissions:
id-token: write # OIDC auth for Vault
contents: read # checkout
steps:
- name: 'get secrets'
id: secrets
uses: SonarSource/vault-action-wrapper@v3
with:
secrets: |
development/github/token/SonarSource-rspec-coverage token | COVERAGE_GITHUB_TOKEN;
- uses: actions/checkout@v4
with:
persist-credentials: true
ref: master
path: 'rspec'
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: 'Install Pipenv'
run: |
pip install pipenv
- name: 'Install rspec-tools'
working-directory: 'rspec/rspec-tools'
run: pipenv install
- name: 'Add Language'
env:
COVERAGE_GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).COVERAGE_GITHUB_TOKEN }}
working-directory: 'rspec/rspec-tools'
run: pipenv run rspec-tools add-lang-to-rule --user ${{ github.actor }} --language "${{ github.event.inputs.language }}" --rule "${{ github.event.inputs.rule }}"