GitHub App icon

GitHub App

Consume GitHub API using GitHub App authentication

File → Delete

AI-generated

Overview

This node operation deletes a file from a specified GitHub repository using GitHub App authentication. It requires the repository owner, repository name, file path, and a commit message. The node constructs the appropriate API request to GitHub to remove the file, including optional parameters such as author, committer, and branch. This operation is useful for automating file removals in repositories, such as cleaning up outdated documentation or removing deprecated code files.

Use Case Examples

  1. Automatically delete a configuration file from a repository branch after a deployment.
  2. Remove obsolete documentation files from a project repository as part of a cleanup workflow.

Properties

Name Meaning
Repository Owner The owner of the GitHub repository from which the file will be deleted. Can be selected from a list, provided as a URL, or entered by name.
Repository Name The name of the GitHub repository containing the file to delete. Can be selected from a list, provided as a URL, or entered by name.
File Path The full path of the file to delete within the repository.
Commit Message The commit message to use for the deletion commit.
Additional Parameters Optional additional fields for the commit, including author details, committer details, and branch to commit to.

Output

JSON

  • success - Indicates if the file deletion was successful (true)

Dependencies

  • GitHub API accessed via GitHub App authentication requiring an API key credential with app ID, installation ID, and private key.

Troubleshooting

  • Common issues include invalid repository owner or name, incorrect file path, or insufficient permissions for the GitHub App to delete files.
  • Error messages may indicate failure to obtain installation access token or failure to access the GitHub API, which can be resolved by verifying credentials and permissions.
  • If the file path points to a folder instead of a file, the operation will fail; ensure the full file path is provided.

Links

Discussion