Repository Tag Protection
This resource allows you to create and manage a repository tag protection for repositories within your GitHub organization or personal account.
Example Usage
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()
.pattern("v*")
.repository("example-repository")
.build());
}
}
Content copied to clipboard
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
Content copied to clipboard