Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Frederick888/gh-ph
`gh-ph` is a GitHub CLI extension and a GitHub Action that puts commit history into your pull request description
https://github.com/Frederick888/gh-ph
gh-extension github-actions pull-requests
Last synced: 3 months ago
JSON representation
`gh-ph` is a GitHub CLI extension and a GitHub Action that puts commit history into your pull request description
- Host: GitHub
- URL: https://github.com/Frederick888/gh-ph
- Owner: Frederick888
- License: gpl-3.0
- Created: 2022-09-20T09:05:21.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-15T14:01:06.000Z (3 months ago)
- Last Synced: 2024-08-15T17:04:10.464Z (3 months ago)
- Topics: gh-extension, github-actions, pull-requests
- Language: Shell
- Homepage:
- Size: 107 KB
- Stars: 9
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub PR History
`gh-ph` is a [`gh`](https://github.com/cli/cli) extension and a GitHub Action that puts commit history into your pull request description.
# Install
`gh extension install Frederick888/gh-ph`
## Dependencies
- [`jq`](https://github.com/stedolan/jq)
- [`bat`](https://github.com/sharkdp/bat)
- Command UNIX CLI utilities such as `tr`, `grep`, `sed`, etc.# Usage
## Command line
Add two `=== GH HISTORY FENCE ===` lines into your PR description. The commit history will be placed between the two fences when you run `gh ph`.
For example,
```markdown
## DescriptionSuper duper fantastic feature.
## Changes
```
## GitHub Actions
First, visit your repository's Settings -> Actions -> General, and select 'Read and write permissions' in 'Workflow permissions'.
Then add the fences to your pull request templates, and finally set up a job as below:
```yaml
on:
pull_request_target:permissions:
contents: read
pull-requests: writejobs:
gh-ph:
name: Add commit history to pull request description
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- run: |
git remote set-branches origin '*'
git fetch --depth 100
- uses: Frederick888/gh-ph@v1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```# Configuration
Default history format can be configured via environment variable [`GH_PH_HISTORY_FORMAT`](https://github.com/Frederick888/gh-ph/blob/1a9fe6f74a6067559885246a67f1d1df9366252c/gh-ph#L12) ([`with.format`](https://github.com/Frederick888/gh-ph/blob/1a9fe6f74a6067559885246a67f1d1df9366252c/action.yml#L8-L11) in Actions).
Per template/section formats can be configured using inline format fences. For example,
```markdown
# Overview
# Details
```
By default it runs history format through [gh format](https://cli.github.com/manual/gh_help_formatting) then [Git pretty formats](https://git-scm.com/docs/pretty-formats).