Pull Requests & CI

Phogit talks to your host’s web API to show a repository’s pull requests (merge requests, on GitLab) and its CI runs. Webhooks call any web address you choose, such as a deploy hook, after a push.

Reading pull requests is free. Creating, commenting on, reviewing and merging them, CI runs and logs, and webhooks need Phogit Pro.

Before you start

There’s nothing extra to set up. Pull requests and CI use the account you saved for the host in Settings › Accounts & Tokens, the same username and token git uses over HTTPS. Phogit picks the account the way git does: the one you chose for the remote in Remotes, otherwise the host’s default account. SSH remotes use the host’s default account.

The token needs permission for what you do:

Host Token permissions
GitHub A classic token with the repo scope, or a fine-grained token with access to the repository and Contents and Pull requests set to Read and write, and Actions set to Read-only.
GitLab The api scope. read_repository and write_repository are enough for git, but not for merge requests.
Bitbucket An Atlassian API token with read:pullrequest:bitbucket (and write:pullrequest:bitbucket to create, approve and merge) and read:pipeline:bitbucket for CI, as well as the repository scopes. Save it with your Bitbucket username, as for git.
Gitea, Forgejo, Codeberg Read and write access to repositories.

See Create a token on your host. If the host turns the token down, Phogit says what that host’s token needs.

Which hosts work

Phogit recognizes the host from the repository’s remote URL:

  • GitHub: github.com.
  • GitLab: gitlab.com, and self-managed servers whose name starts with gitlab..
  • Bitbucket Cloud: bitbucket.org.
  • Gitea and Forgejo: codeberg.org, gitea.com, and servers whose name starts with gitea. or forgejo..

Other hosts, such as GitHub Enterprise Server and Azure DevOps, say they aren’t supported. Git itself still works with them as usual.

Pull requests

To see a repository’s pull requests, tap the sync button and choose Pull Requests…. On iPad, choose Pull Requests in the sidebar’s Navigate section; the list fills the middle column and the pull request you pick opens beside it.

Choose Open or Closed at the top; Closed includes merged ones. Each row shows the title, number and author, the branch it comes from and the one it goes into, when it was last updated, and its state. Pull down to refresh.

Read a pull request

Tap a pull request to see:

  • its title, state, author and branches;
  • its Description, shown as formatted Markdown;
  • Checks: the CI runs for its latest commit, with their status. Tapping one opens the run (Phogit Pro);
  • its Comments.

The Safari button at the top (Open on GitHub, or your host’s name) opens it in the browser. Pull down to reload it.

Comment Pro

Type in Leave a comment at the bottom and tap Comment. Markdown works, and the comment is posted as the account Phogit uses for the repository.

Review Pro

  • Approve approves the pull request.
  • Request Changes… asks what needs to change; tap Send to post your comment with the review.

GitLab’s API can only approve, so merge requests on GitLab offer Approve without Request Changes….

Merge Pro

Tap Merge… and choose how: Merge, Squash and Merge, Rebase and Merge or Fast-Forward Merge. Phogit offers only the methods the host allows for that repository. The host does the merge; fetch or pull afterwards to bring it into your copy.

Create a pull request Pro

You can start a pull request from three places:

  • After a push. When you push a branch other than the repository’s default branch, the Push sheet changes to Pushed and offers Create Pull Request….
  • Branches. Long-press a local branch and choose Create Pull Request….
  • The list. Tap + (New Pull Request) in Pull Requests.

The New Pull Request form is filled in for you: the title from the branch’s latest commit, the branch under From, and the repository’s default branch under Into. Edit the Title, add a Description (Markdown works), check the target branch, and tap Create. If the branch already has an open pull request, the form says so and links to it.

CI runs and logs Pro

Phogit shows runs from GitHub Actions, GitLab CI, Bitbucket Pipelines, and Gitea and Forgejo Actions.

Tap the sync button and choose CI Runs…. Choose This Branch or All Branches at the top. Each run shows its status, name and number, branch, commit and how long it took. Runs load 20 at a time; tap Load More for older ones.

Tap a run to see its Status, Branch, Commit and Duration, a button to open it on the host, and its Jobs (Steps, on Bitbucket). Tap a job to read its log:

  • Lines are numbered, with color codes removed.
  • Find in Log highlights matches; Log Options › Matching Lines Only hides the other lines.

CI status also shows up elsewhere:

  • A pull request’s Checks list its latest commit’s runs.
  • In the commit graph, a colored dot beside each recent commit’s SHA shows its newest run’s status, and the commit’s details list its Checks.

Gitea logs need Gitea 1.23 or later. Older Gitea and Forgejo servers say their logs aren’t available.

Webhooks Pro

A webhook calls a web address with the repository, branch and commit: a deploy hook, a CI trigger or a chat notification, for example. Webhooks work with any repository, whatever its host, and belong to the repository you add them to.

Tap the sync button and choose Webhooks…, then Add Webhook:

  1. Enter a Name, such as Deploy to staging, and the address (http or https).
  2. Choose the Method: POST, PUT or PATCH.
  3. Leave Enabled on, and turn on Run After Every Push if it should run whenever you push.
  4. Write the Body. {repo}, {branch} and {sha} are filled in when it runs; in a JSON body they’re escaped for you.
  5. Add any Headers with Add Header, for example an Authorization token. Turn on the lock next to a header to keep its value in the Keychain; headers that look secret are kept there anyway.
  6. To let the receiver check the call came from you, turn on Sign with HMAC-SHA256 and enter a signing secret. The header (X-Hub-Signature-256 unless you change it) carries sha256= and the HMAC-SHA256 of the body, as GitHub’s webhooks do.
  7. Tap Save.

Tap Run next to a webhook to call it now, with the branch you have checked out and its latest commit. After a push, webhooks set to Run After Every Push get the pushed branch and its newest commit; the banner says they ran, or an alert says which one failed and why. Each webhook shows its last result, and its Last Run section shows the server’s response.

To remove a webhook, swipe left on it and tap Remove. Its secrets are deleted from the Keychain too.