Skip to content

Repository files navigation

Github Sync Files Action

Copies files from a repo to the same or an other repo.
For example, showcase/README.md is synced with Knerio/Knerio/README.md

Action Setup

name: Run the workflowon:
schedule:
- cron: "*/10 * * * *"# Runs every 10 minutesworkflow_dispatch:
permissions:
contents: write # This is requiredjobs:
run:
runs-on: ubuntu-lateststeps:
- uses: "actions/checkout@v4"
- uses: "knerio/GithubSyncFilesAction@main"with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} #This is optionalCONFIG: "./.github/sync.config.yml"# This is optional and defaults to "./.github/sync.config.yml"

The parameters GITHUB_TOKEN, CONFIG are optional.

Configuration

The configuration location is configured above and also can be changed. The configuration looks like this and can be also found here:

commit-message: "Global commit message"# Optional, defaults to "Sync GitHub files"entries:
- commit-message: "Sync README"# Optionally, Overwrites the global commit messagefrom: # Copies from The repo Knerio/Knerio the file README.mdrepo: "Knerio/Knerio"# Optionally, if not set, the repository of the action is getting selectedfile: "README.md"to: # Pastes as README.md (can also be renamed) in Knerio/GithubSyncFilesActionrepo: "Knerio/GithubSyncFilesAction"# Optionally, if not set, the repository of the action is getting selectedfile: "showcase/README.md"
- ignored:
- "*.config.yml"# You can also exclude files and directoriesfrom:
repo: "Knerio/Knerio"# Optionally, if not set, the repository of the action is getting selectedfile: ".github/"# You can also copy a whole directoryto:
repo: "Knerio/GithubSyncFilesAction"file: "showcase/second/"# Optionally, if not set, the repository of the action is getting selected

Shorthandform

This is also explained above, but its mentioned here too. You can also use the short form if you don't need to specify repositories (it just uses the repo where the action is getting executed):

entries:
- from: file: "README.md"to: file: "README"

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages