-
-
Notifications
You must be signed in to change notification settings - Fork 354
/
action.yml
43 lines (41 loc) · 1.2 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
name: Push documentation
inputs:
docs_repo_dir:
description: "The skript-docs repository directory"
required: true
type: string
git_email:
description: "The email to use for the Git commit"
required: true
type: string
git_name:
description: "The name to use for the Git commit"
required: true
type: string
git_commit_message:
description: "The message to use for the Git commit"
required: true
type: string
runs:
using: 'composite'
steps:
- shell: bash
if: success()
env:
DOCS_REPO_DIR: ${{ inputs.docs_repo_dir }}
GIT_EMAIL: ${{ inputs.git_email }}
GIT_NAME: ${{ inputs.git_name }}
GIT_COMMIT_MESSAGE: ${{ inputs.git_commit_message }}
run: |
cd "${DOCS_REPO_DIR}"
git config user.name "${GIT_NAME}"
git config user.email "${GIT_EMAIL}"
git add -A
git commit -m "${GIT_COMMIT_MESSAGE}" || (echo "Nothing to push!" && exit 0)
# Attempt rebasing and pushing 5 times in case another job pushes before us
for i in 1 2 3 4 5
do
git pull --rebase -X theirs origin main
git push origin main && break
sleep 5
done