generated from AndreasAugustin/template
-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
action.yml
125 lines (125 loc) · 5.34 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: "actions-template-sync"
description: "Synchronises changes of the template repository"
author: "AndreasAugustin"
branding:
icon: cloud
color: green
inputs:
github_token:
description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}'
required: true
default: ${{ github.token }}
source_repo_path:
description: "Repository path of the template"
required: true
upstream_branch:
description: "The target branch"
source_repo_ssh_private_key:
description: "[optional] private ssh key for the source repository. E.q. useful if using a private template repository."
pr_branch_name_prefix:
description: "[optional] the prefix of branches created by this action"
default: "chore/template_sync"
pr_title:
description: "[optional] the title of PRs opened by this action"
default: "upstream merge template repository"
pr_body:
description: "[optional] the body of PRs opened by this action"
pr_labels:
description: "[optional] comma separated list of pull request labels"
default: "template_sync"
pr_reviewers:
description: "[optional] comma separated list of pull request reviewers"
pr_commit_msg:
description: "[optional] the commit message of the template merge"
default: "chore(template): merge template changes :up:"
hostname:
description: "[optional] the hostname of the GitHub repository"
default: "github.com"
is_dry_run:
description: "[optional] set to true if you do not want to push the changes and not want to create a PR"
is_allow_hooks:
description: "[optional] set to true if you want to allow hooks. Use this functionality with caution!"
default: "false"
hooks:
description: "[optional] define the hooks as yaml string input"
is_force_push_pr:
description: "[optional] set to true if you want to force push and pr update"
default: "false"
is_pr_cleanup:
description: "[optional] set to true if you want to cleanup older PRs targeting the same branch."
default: "false"
is_keep_branch_on_pr_cleanup:
description: "[optional] set to true if you want to keep the branch when pr is cleanup"
default: "false"
is_not_source_github:
description: "[optional] set to true if the source repository is not a github related repository. Useful e.q. if the source is GitLab"
default: "false"
is_force_deletion:
description: "[optional] set to true if you want to force delete files which are deleted within the source repository even if they contain changes"
default: "false"
is_git_lfs:
description: "[optional] set to true if you want to enable git lfs"
default: "false"
git_user_name:
description: "[optional] set the committer git user.name for the merge commit"
git_user_email:
description: "[optional] set the committer git user.email for the merge commit"
git_remote_pull_params:
description: "[optional] set the pull parameters for the remote repository"
gpg_private_key:
description: "[optional] set the gpg private key if you want to sign your commits"
gpg_passphrase:
description: "[optional] set if your private gpg key has a password"
steps:
description: "[optional] set the steps to execute within the action"
template_sync_ignore_file_path:
description: "[optional] set the path to the ignore file"
default: ".templatesyncignore"
is_with_tags:
description: "[optional] set to true if tags should be synced"
default: "false"
outputs:
pr_branch:
description: "The name of the PR branch"
value: ${{ steps.sync.outputs.pr_branch }}
template_git_hash:
description: "The git hash of the template source repository"
value: ${{ steps.sync.outputs.template_git_hash }}
runs:
using: "composite"
# image: "src/Dockerfile"
steps:
- name: github sync
run: ${{github.action_path}}/src/entrypoint.sh
# working-directory: src/
shell: bash
id: sync
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
SOURCE_REPO_PATH: ${{ inputs.source_repo_path }}
UPSTREAM_BRANCH: ${{ inputs.upstream_branch }}
SSH_PRIVATE_KEY_SRC: ${{ inputs.source_repo_ssh_private_key }}
PR_BRANCH_NAME_PREFIX: ${{ inputs.pr_branch_name_prefix }}
PR_TITLE: ${{ inputs.pr_title }}
PR_BODY: ${{ inputs.pr_body }}
PR_LABELS: ${{ inputs.pr_labels }}
PR_REVIEWERS: ${{ inputs.pr_reviewers }}
PR_COMMIT_MSG: ${{ inputs.pr_commit_msg }}
HOSTNAME: ${{ inputs.hostname }}
IS_DRY_RUN: ${{ inputs.is_dry_run }}
IS_ALLOW_HOOKS: ${{ inputs.is_allow_hooks }}
HOOKS: ${{ inputs.hooks }}
IS_FORCE_PUSH_PR: ${{ inputs.is_force_push_pr }}
IS_GIT_LFS: ${{ inputs.is_git_lfs }}
IS_PR_CLEANUP: ${{ inputs.is_pr_cleanup}}
IS_KEEP_BRANCH_ON_PR_CLEANUP: ${{ inputs.is_keep_branch_on_pr_cleanup }}
IS_NOT_SOURCE_GITHUB: ${{ inputs.is_not_source_github }}
IS_FORCE_DELETION: ${{ inputs.is_force_deletion }}
GIT_USER_NAME: ${{ inputs.git_user_name }}
GIT_USER_EMAIL: ${{ inputs.git_user_email }}
GIT_REMOTE_PULL_PARAMS: ${{ inputs.git_remote_pull_params }}
GPG_PRIVATE_KEY: ${{ inputs.gpg_private_key }}
GPG_PASSPHRASE: ${{ inputs.gpg_passphrase }}
STEPS: ${{ inputs.steps }}
TEMPLATE_SYNC_IGNORE_FILE_PATH: ${{ inputs.template_sync_ignore_file_path }}
IS_WITH_TAGS: ${{ inputs.is_with_tags }}