-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
38 lines (38 loc) · 2.19 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
name: "anyone-push-back-repo"
author: "Zhang Nan (zhang_nan_163@163.com)"
branding:
icon: git-commit
color: green
description: "This action help you push back to pull request when user made changes in action. Then use it to push back to your repo"
inputs:
strategy-option:
description: "action will rebase to target branch with specific strategy. usually will use -X<strategy-option>. default is 'ours'. Please reference here: https://www.atlassian.com/git/tutorials/using-branches/merge-strategy"
required: false
default: "ours"
actor:
description: "commiter username. default will retrieve from actor environment variable"
required: false
default: ${{ github.actor }}
actor-email:
description: "committer email. defail will use `actor`@users.noreply.github.com"
required: false
default: ${{ github.actor }}@users.noreply.github.com
outputs:
modified:
description: 'modified flag 1 as "true" or 0 as "false"'
value: ${{ steps.status.outputs.modified }}
runs:
using: "composite"
steps:
- name: Grant execution permission
run: |
chmod +x ${{ github.action_path }}/git-status.sh
chmod +x ${{ github.action_path }}/git-push.sh
shell: bash
- name: Check status
id: status
run: ${{ github.action_path }}/git-status.sh
shell: bash
- name: Commit changes
run: ${{ github.action_path }}/git-push.sh ${{ steps.status.outputs.modified }} $(if [[ "${{ inputs.actor }}" == "" ]]; then echo "_"; else echo "${{ inputs.actor }}"; fi) $(if [[ "${{ inputs.actor-email }}" == "" ]]; then echo "_"; else echo "${{ inputs.actor-email }}"; fi) $(if [[ "${{github.head_ref}}" == "" ]]; then echo "_"; else echo "${{github.head_ref}}"; fi) $(if [[ "${{github.base_ref}}" == "" ]]; then echo "_"; else echo "${{github.base_ref}}"; fi) $(if [[ "${{github.ref}}" == "" ]]; then echo "_"; else echo "${{github.ref}}"; fi) $(if [[ "${{ inputs.strategy-option }}" == "" ]]; then echo "_"; else echo "${{ inputs.strategy-option }}"; fi) $(if [[ "${{github.workflow}}" == "" ]]; then echo "_"; else echo "${{github.workflow}}"; fi) $(if [[ "${{github.run_number}}" == "" ]]; then echo "_"; else echo "${{github.run_number}}"; fi)
shell: bash