/greposync-action

GitHub Action for ccremer/greposync

Primary LanguageShellApache License 2.0Apache-2.0

ccremer/greposync-action

Version

GitHub Action for ccremer/greposync

Setup

Configure the step

Specify the action as part of your GitHub actions workflow:

- name: Run greposync
  uses: ccremer/greposync-action@v0
  env:
    GITHUB_TOKEN: ${{ secrets.GREPOSYNC_TOKEN }}
  with:
    args: update --help
Tip

${{ secrets.GITHUB_TOKEN }} only grants rights to the current repository, which makes no sense for greposync as it clones and manages other repositories. Use a PAT (Personal Access Token) instead.

Full example

name: Sync

on:
  workflow_dispatch:
    inputs:
      filter:
        description: 'Filter sync for a specific repository (exact name or regex)'
        required: false
        default: ''
  push:
    branches:
      - master
      - main

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Configure Git
        run: |
          git config --global user.name "$GITHUB_ACTOR"
          git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
      - name: Setup SSH
        uses: webfactory/ssh-agent@v0.5.3
        with:
            ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
      - name: Run greposync
        uses: ccremer/greposync-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GREPOSYNC_TOKEN }}
        with:
          args: update --pr --filter=${{ github.event.inputs.filter }}

Customization

Configuration

- name: Run greposync
  uses: ccremer/greposync-action@v0
  with:
    version: latest
    args: update --pr
Table 1. Parameters
Input Description Default

version

The release version greposync to install. Must match the exact tag. Use latest to install the latest stable release.

latest

args

A string of arguments to pass to greposync. This value is required!

Contribute

See available make targets with

$ make help

When creating a PR, please fill in the PR template as best as you know.