Skip to content

ohmycheatsheet/actions-updater

Repository files navigation

@omcs/actions-updater

fetch remote source repo and update current repo

npm GitHub

features

In default, this action will diff source-template-repo and current-repo by filepath recursive

  • deleted: if current/a.file not exist in source, a.file will be deleted.
  • add: if current/a.file not exist, but source/a.file exist, a.file will be added.
  • update: if current/a.file and source/a.file exist, force update current/a.file

Friendly pr

  • read changelog as pr body
  • bump version like dependabot

image

usage

  1. create file updater.yml in .github/workflows
  2. add following code to updater.yml file
name: "updater"

on:
  schedule:
    - cron: "0 23 * * *"

jobs:
  # test action works running from the schedule
  cronjob:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: ohmycheatsheet/actions-updater@v1
      with:
        repo: ohmycheatsheet/cheatsheets
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

variables

name description type required
repo (input) source repo string true
ignores (input) ignore update files string[] false
GITHUB_TOKEN (env) create/update pr string true

development

Setup environment

  1. copy .env.sample file
  2. replace GITHUB_TOKEN

Users shouldn't consume the action from master since that would be latest code and actions can break compatibility between major versions.

Checkin to the v1 release branch

pnpm
pnpm run prepare
ga .
gpsup

See the versioning documentation, the toolkit documentation for the various packages.

See the toolkit documentation for the various packages.

change action.yml

The action.yml defines the inputs and output for your action.

Update the action.yml with your name, description, inputs and outputs for your action.

See the documentation

built with ❤️ by 😼

About

fetch remote source repo and update current repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published