Project to test/sync ci to all my mods
I'm a Powershell user, so my scripts are with Powershell.
Config file to store the projects.
{
"projects": [
{
"id": "user/repository",
"branches": ["branch1", "branch2"]
}
]
}
list_project.ps1
: Print a list of the projects.update_project.ps1 -Id "user/repo" (-Editor "text-editor-cmd")
: Create or update a project, will open a file with an editor to select which branch to sync.delete_project.ps1 -Id "user/repo"
: Delete a project.get_project.ps1 -Id "user/repo"
: Get a project.update_sync_commit.ps1 (-Editor "text-editor-cmd") (-Message "commit message")
: Set the sync commit message.init.ps1
: Init the project.json file, done by default with the other scripts.sync.ps1
: Sync the projects. See Sync process
all files in the common.github
directory will be sync into the branches/projects with one commit with the message described in sync_commit_message.txt
.
By default it should be used using the .github/workflows/sync.yml
workflow.
for forks, 2 secrets are required to config the account to push the sync commits, this account should have at least the repository and workflows permissions on the project's repositories.
GH_PAT
: Github token/password.GH_USERNAME
: Github username.
You can run the command to sync by using this command:
scripts/sync.ps1 `
-IKnowWhatImDoing `
-File "config/project.json"`
-GitUser 'username for the sync commit'`
-GitMail 'mail for the sync commit'`
-GitPushUser 'Github username'`
-GitPassword 'Github password or token'
The names are pretty much self explaining, but:
-IKnowWhatImDoing
: Mandadory, admit it'll be your fault.-File
: project.json file, by default"config/project.json"
.-GitUser
: username for the sync commit.-GitMail
: mail for the sync commit.-GitPushUser
: Github username to push the sync commit.-GitPassword
: Github password or token to push the sync commit.