This will commit a file directly on GitHub via the API

Commits a file directly to GitHub. You must provide your GitHub Personal token (get one from, the repository name and the relative file path from the root git project. Out parameters provide the commit sha created, which can be used for later usage for examples such as releases, the direct download link and the full response JSON. Documentation:

Supported platforms ios, android, mac
Author @tommeier
Returns A hash containing all relevant information for this commit
Access things like 'html_url', 'sha', 'message'

1 Example

response = commit_github_file(
  repository_name: "fastlane/fastlane",
  server_url: "",
  api_token: ENV["GITHUB_TOKEN"],
  message: "Add my new file",
  branch: "master",
  path: "assets/my_new_file.xcarchive"


Key Description Default
repository_name The path to your repo, e.g. 'fastlane/fastlane'
server_url The server url. e.g. '' (Default: '')
api_token Personal API Token for GitHub - generate one at *
branch The branch that the file should be committed on (default: master) master
path The relative path to your file from project root e.g. assets/my_app.xcarchive
message The commit message. Defaults to the file name *
secure Optionally disable secure requests (ssl_verify_peer) true

* = default value is dependent on the user's system

To show the documentation in your terminal, run

fastlane action commit_github_file

View source code

Back to actions