rspec/.github/workflows/create_new_rspec.yml
Michael Jabbour 765538f971
Explicit permissions for GITHUB_TOKEN where write is needed
The default GITHUB_TOKEN permissions will be set to read-only. See https://sonarsource.atlassian.net/browse/SSF-619 for background information.
2024-09-18 12:03:16 +02:00

43 lines
1022 B
YAML

name: Create New RSPEC
# Workflow runs when manually triggered using the UI or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
languages:
description: 'Comma-separated list of targeted languages'
required: true
jobs:
create_new_rule:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- 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: 'Create Rule'
working-directory: 'rspec/rspec-tools'
run: pipenv run rspec-tools create-rule --user ${{ github.actor }} --languages "${{ github.event.inputs.languages }}"