An open API service indexing awesome lists of open source software.

https://github.com/nasa-pds/git-ping

An action for GitHub Actions that "pings" a repository by doing an "empty-commit" to it, developed by the PDS Engineering Node.
https://github.com/nasa-pds/git-ping

action github pds

Last synced: 2 months ago
JSON representation

An action for GitHub Actions that "pings" a repository by doing an "empty-commit" to it, developed by the PDS Engineering Node.

Awesome Lists containing this project

README

          

# 📡 PDS Engineering Actions: Git Ping

This is an [action for GitHub](https://github.com/features/actions) that "pings" a repository branch by creating an empty commit and pushing to a specified branch. This is typically used to just trigger a GitHub action from another action's workflow.

## â„šī¸ Using this Action

To use this action in your own workflow, just provide it `with` the following parameters:

- `repository`: The target repository name, with owner name separated by a slash, such as `nasa-pds/pdsen-corral`.
- `token`: A GitHub personal access token
- `branch`: The name of the branch to which to send the empty commit.
- `message`: The log message to use with the commit.

### đŸ‘Žâ€â™‚ī¸ Personal Access Token

Note that in order to make the "ping" or "empty commit" to a repository, this action must havea access to repositories. This is afforded by the `token`. To set up such a token:

1. Vist your GitHub account's Settings.
2. Go to "Developer Settings".
3. Go to "Personal access tokens".
4. Press "Generate new token"; authenticate if needed.
5. Add a note for the token, such as "PDS Ping Repo Access"
6. Check the following scopes:
- `repo:status`
- `repo_deployment`
- `public_repo`
7. Press "Generate new token"

Save the token (a hex string) and install it in your source, **not target**, repository:

1. Visit the source repository's web page on GitHub.
2. Go to "Settings".
3. Go to "Secrets".
4. Press "New secret".
5. Name the secret, such as `ADMIN_GITHUB_TOKEN`, and insert the token's saved hex string as the value.
6. Press "Add secret".

Use this name in the source's workflow, such as `${{secrets.ADMIN_GITHUB_TOKEN}}`. You should now destroy any saved copies of the token's hex string.

## đŸ’â€â™€ī¸ Demonstration

The following is a brief example how a workflow that shows how this action can be used:

```yaml
name: 👩‍đŸĢ Stable Genius Release
on:
push:
branches:
- main
jobs:
build:
name: đŸ‘ˇâ€â™€ī¸ Build Job
runs-on: ubuntu-latest
steps:
- name: đŸ’ŗ Check out the code
uses: actions/checkout@v2
- name: 🔧 Do something with it
uses: â€Ļ
- name: 📡 Ping the PDS Engineering Corral
uses: NASA-PDS/git-ping@main
with:
repository: nasa-pds/pdsen-corral
token: ${{secrets.ADMIN_GITHUB_TOKEN}}
branch: main
message: Stable Genius service upgraded to ${{github.ref}}
```