Skip to main content

GitHub_Commit-Macro.png GitHub Commit Tool

Use GitHub Commit to commit a file, directory of files, or the workflow it's used in, to a GitHub repository via the GitHub API.

ヒント

This tool is not automatically installed with Alteryx Designer. To use this tool, download it from the Alteryx Marketplace.

Tool Components

GitHub Commit has 2 anchors:

  • Input anchor: Use the optional input anchor to pass fields into GitHub Commit. If you use this input, the incoming data stream needs to include…

    • File Path: The directory path where the file lives locally.

    • Target Path: The desired location in the GitHub repository for the file to be committed.

      • If nested folders exist, separate them with a forward slash (/). For example, Alteryx/Macros/GitHubCommit.yxmc.

      • If you leave the Target Path empty (Batch Commit mode) or with the default text (Self Commit mode), this allows you to commit to the root of the repository.

  • Output anchor: The output anchor returns the results of the commit returned by the API.

Configure the Tool

Use the Tool Configuration window to configure the necessary fields to make the API call.

Mode

Use the Mode tab to select your commit mode: Batch Commit or Self Commit.

Disable macro: Check this check box to disable GitHub Commit and prevent it from making any commits. A warning message displays in the Results window that indicates that the tool is disabled.

Batch Commit

Use Batch Commit mode to commit local files to a specified GitHub repository. You can use this option to commit a single file or a group of files. You can use a Directory Input tool to commit an entire folder.

Batch Commit requires that you map both a file path and target path field via the 2 available dropdowns.

Self Commit

Use Self Commit mode to commit the workflow that the macro is used in, to a specified GitHub repository. Add GitHub Commit to the completed workflow, configure, and run. This mode uses environment variables to obtain the file path and name for the workflow it is used in to make the commit. Note that you must save any changes to the workflow before you run GitHub Commit or the changes are not reflected in the commit.

Self Commit requires that you map a target path field via the Target GitHub Directory dropdown.

Configure

Use the Configure tab to provide GitHub owner, repository, and branch details.

  • GitHub Repo Owner (username): Enter the GitHub username of the owner of the target repository. This can’t be your username. If you are committing to someone else’s repository, use their username here.

  • GitHub Repository Name: Enter the name of the repository where you want to commit the files.

  • Branch: Enter the name of the branch where you want to make the commit.

    • Is protected: Check this check box if the branch is protected.

  • Commit Message (Required): Enter a message to go with your commit. Note that the workflow returns an error if you leave this empty even if you've disabled GitHub Commit.

Authentication

Use the Authentication tab to provide your GitHub API base address and access token.

  • GitHub API base Address: The tool adds this by default, but you can update it if needed.

  • GitHub Personal Access Token: Enter your personal access token for GitHub. For more information on personal access tokens, go to GitHub documentation.