-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
57 lines (51 loc) · 1.92 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
name: Git push over SSH
description: "A composite action to securely push changes to a remote Git repository over SSH."
author: Dr. Kibitz (@drkibitz)
inputs:
debug:
description: "Set to `true` to enable debug logging (default: `false`)."
required: false
default: "false"
push-options:
description: "Additional options for the `git push` command (e.g., `--force` or `--tags`). Leave empty for default behavior."
required: false
remote-ref:
description: "The branch, tag, or commit SHA to push to the remote repository. Default: `HEAD`."
required: false
default: "HEAD"
remote-url:
description: "The Git+SSH URL of the remote repository (e.g., `git@hostname:user/repo.git`, `ssh://user@hostname:port/repo.git`)."
required: true
ssh-private-key:
description: "The SSH private key used to authenticate with the remote repository."
required: true
outputs:
push-log:
description: "The path to the log file containing the output of the `git push` command."
value: ${{ steps.git-push.outputs.push-log }}
runs:
using: composite
steps:
- name: Parse Git+SSH URL
id: parse-url
uses: drkibitz/github/actions/parse-git-ssh-url@main
with:
url: ${{ inputs.remote-url }}
- name: Setup SSH agent
uses: drkibitz/github/actions/setup-ssh-agent@main
with:
port: ${{ steps.parse-url.outputs.port }}
username: ${{ steps.parse-url.outputs.username }}
hostname: ${{ steps.parse-url.outputs.hostname }}
ssh-private-key: ${{ inputs.ssh-private-key }}
- name: Git push
id: git-push
uses: drkibitz/github/actions/git-push@main
with:
debug: ${{ inputs.debug }}
push-options: ${{ inputs.push-options }}
remote-ref: ${{ inputs.remote-ref }}
remote-url: ${{ inputs.remote-url }}
- name: Teardown SSH agent
uses: drkibitz/github/actions/teardown-ssh-agent@main
if: always()