RepositoryTagProtection

class RepositoryTagProtection : KotlinCustomResource

This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = new github.RepositoryTagProtection("example", {
repository: "example-repository",
pattern: "v*",
});
import pulumi
import pulumi_github as github
example = github.RepositoryTagProtection("example",
repository="example-repository",
pattern="v*")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var example = new Github.RepositoryTagProtection("example", new()
{
Repository = "example-repository",
Pattern = "v*",
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.NewRepositoryTagProtection(ctx, "example", &github.RepositoryTagProtectionArgs{
Repository: pulumi.String("example-repository"),
Pattern: pulumi.String("v*"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.RepositoryTagProtection;
import com.pulumi.github.RepositoryTagProtectionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new RepositoryTagProtection("example", RepositoryTagProtectionArgs.builder()
.repository("example-repository")
.pattern("v*")
.build());
}
}
resources:
example:
type: github:RepositoryTagProtection
properties:
repository: example-repository
pattern: v*

Import

Repository tag protections can be imported using the name of the repository, combined with the id of the tag protection, separated by a / character. The id of the tag protection can be found using the GitHub API. Importing uses the name of the repository, as well as the ID of the tag protection, e.g.

$ pulumi import github:index/repositoryTagProtection:RepositoryTagProtection terraform my-repo/31077

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pattern: Output<String>

The pattern of the tag to protect.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repository: Output<String>

Name of the repository to add the tag protection to.

Link copied to clipboard
val tagProtectionId: Output<Int>

The ID of the tag protection.

Link copied to clipboard
val urn: Output<String>