Skip to content

GitHub Repositories

Use these actions when a mold manages repository-level resources: the repository itself, topics, or pull requests.

All GitHub actions use the Forge GitHub App configured for your tenant. Users do not need to paste GitHub tokens into molds.

Creates a GitHub repository. If the repository already exists, the action returns the existing repository instead of failing.

steps:
- id: create-repo
name: Create repository
action: github.repo.create
inputs:
name: "${{ inputs.name }}"
owner: "${{ inputs.owner }}"
description: "${{ inputs.description }}"
private: "${{ inputs.private }}"
auto_init: true
topics:
- shoehorn
- service
custom_properties:
managed-by: shoehorn
service-type: api

Common inputs:

InputRequiredDescription
nameYesRepository name
ownerYesOrganization or owner, for example github.com/adaptive-labs or adaptive-labs
descriptionNoRepository description
homepageNoRepository homepage URL
privateNoWhether the repository is private
visibilityNoGitHub visibility value, such as private or public
auto_initNoCreate the first commit so file actions can write immediately
gitignore_templateNoGitHub .gitignore template name, such as Go
license_templateNoGitHub license key, such as mit
topicsNoRepository topics to set
custom_propertiesNoGitHub organization custom properties
custom_properties_requiredNoFail the run if custom properties cannot be applied

Custom properties require GitHub organization support and the right app permissions. By default, Forge logs a warning and continues if GitHub rejects the custom properties request. Set custom_properties_required: true when those properties must be applied before the mold can be considered successful.

Outputs include the repository name, full name, clone URLs, default branch, and HTML URL.

Updates settings on an existing repository.

steps:
- id: update-repo
name: Update repository settings
action: github.repo.update
inputs:
owner: "${{ inputs.owner }}"
repo: "${{ inputs.name }}"
description: "${{ inputs.description }}"
private: "${{ inputs.private }}"
custom_properties:
lifecycle: production

Use this when the repository already exists and the mold should align its settings.

Replaces the repository topic list.

steps:
- id: set-topics
name: Set repository topics
action: github.topics.set
inputs:
owner: "${{ inputs.owner }}"
repo: "${{ inputs.name }}"
topics:
- shoehorn
- golang
- service

Use this when topics are managed by the mold and should be fully controlled by Forge.

Creates a pull request. If a pull request already exists for the same head and base branch, Forge returns the existing one.

steps:
- id: open-pr
name: Open pull request
action: github.pr.create
inputs:
owner: "${{ inputs.owner }}"
repo: "${{ inputs.name }}"
title: "Add service scaffold"
body: "Created by Shoehorn Forge."
head: scaffold-service
base: main

Required inputs are owner, repo, title, and head. base defaults to main.