Roadie

Add Repository To Codacy

Action ID: codacy:add-repo
NPM Package:

@codacy/backstage-plugin

Description

Adds a repository to Codacy for code quality analysis and monitoring.

Input Schema

PropertyTypeDescriptionRequired
ownerany-
providerany-
repositoryany-

Output Schema

No output schema defined for this action.

Usage Examples

Add a new GitHub organization repo to Codacy after publishing

This adds a newly created GitHub repository to Codacy. Use it when your workflow publishes code with publish:github after generating files with fetch:template.

yaml
steps:
  - id: fetch-base
    action: fetch:template
    input:
      url: ./skeleton
      targetPath: .
      values:
        name: ${{ parameters.serviceName }}
        description: ${{ parameters.description }}

  - id: publish-github
    action: publish:github
    input:
      repoUrl: github.com?owner=acme-inc&repo=payments-api
      description: Payments API service
      defaultBranch: main

  - id: codacy-add-repo
    action: codacy:add-repo
    input:
      provider: github
      owner: acme-inc
      repository: payments-api

Parameterized GitHub owner and repo from template inputs

This uses template parameters for the GitHub owner and repo. Use when the same template supports multiple teams or repo names.

yaml
steps:
  - id: fetch-svc
    action: fetch:template
    input:
      url: ./skeleton
      targetPath: .
      values:
        name: ${{ parameters.repoName }}
        owner: ${{ parameters.githubOrg }}

  - id: publish-github
    action: publish:github
    input:
      repoUrl: github.com?owner=${{ parameters.githubOrg }}&repo=${{ parameters.repoName }}
      defaultBranch: main

  - id: codacy-add-repo
    action: codacy:add-repo
    input:
      provider: github
      owner: ${{ parameters.githubOrg }}
      repository: ${{ parameters.repoName }}

Add a GitLab group project to Codacy in a GitLab-based workflow

This adds a GitLab project to Codacy. Use it when you publish to GitLab with publish:gitlab.

yaml
steps:
  - id: fetch-svc
    action: fetch:template
    input:
      url: ./gitlab-skeleton
      targetPath: .
      values:
        name: ${{ parameters.projectName }}
        group: ${{ parameters.gitlabGroup }}

  - id: publish-gitlab
    action: publish:gitlab
    input:
      repoUrl: gitlab.com?owner=${{ parameters.gitlabGroup }}&repo=${{ parameters.projectName }}
      defaultBranch: main

  - id: codacy-add-repo
    action: codacy:add-repo
    input:
      provider: gitlab
      owner: ${{ parameters.gitlabGroup }}
      repository: ${{ parameters.projectName }}

Add a Bitbucket Cloud repository to Codacy

This adds a Bitbucket Cloud repository owned by a workspace to Codacy. Use it with publish:bitbucket when your org uses Bitbucket.

yaml
steps:
  - id: fetch-app
    action: fetch:template
    input:
      url: ./bitbucket-skeleton
      targetPath: .
      values:
        name: ${{ parameters.repoName }}
        workspace: ${{ parameters.bitbucketWorkspace }}

  - id: publish-bb
    action: publish:bitbucket
    input:
      repoUrl: bitbucket.org?owner=${{ parameters.bitbucketWorkspace }}&repo=${{ parameters.repoName }}
      description: CLI tool for build automation
      defaultBranch: main

  - id: codacy-add-repo
    action: codacy:add-repo
    input:
      provider: bitbucket
      owner: ${{ parameters.bitbucketWorkspace }}
      repository: ${{ parameters.repoName }}