File tree 1 file changed +10
-4
lines changed
.github/actions/deploy-dir-as-branch 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11
11
- name : Creating temporary directory to clone the branch
12
12
shell : bash
13
13
run : |
14
- BRANCH_DIR=$(mktemp -d "`pwd`/cloned_${{ inputs.target_branch }}_XXXXXX ")
14
+ BRANCH_DIR=$(mktemp -d "`pwd`/$BRANCH_DIR_TEMPLATE ")
15
15
echo "BRANCH_DIR=$BRANCH_DIR" >> $GITHUB_ENV
16
+ env :
17
+ BRANCH_DIR_TEMPLATE : ' cloned_${{ inputs.target_branch }}_XXXXXX'
16
18
17
19
- name : Checkout `${{ inputs.target_branch }}` branch
18
20
uses : actions/checkout@v2
31
33
echo '::endgroup::'
32
34
33
35
echo '::group::Move necessary files'
34
- cp -vnR '${{ github.workspace }}/${{ inputs.src_dir }}/.' .
36
+ cp -vnR "$SRC_DIR/." .
35
37
echo '::endgroup::'
36
38
37
39
git add -A
@@ -41,12 +43,16 @@ runs:
41
43
git config user.name 'GitHub Action Script'
42
44
git config user.email '[email protected] '
43
45
44
- git commit -a -m ' Deploy ${{ github.sha }} to '${{ inputs.target_branch }} ' branch'
46
+ git commit -a -m " Deploy $SHA to '$TARGET_BRANCH ' branch"
45
47
git push
46
48
echo 'Pushed'
47
49
fi
50
+ env :
51
+ SRC_DIR : ' ${{ github.workspace }}/${{ inputs.src_dir }}'
52
+ SHA : ${{ github.sha }}
53
+ TARGET_BRANCH : ${{ inputs.target_branch }}
48
54
49
55
- name : Remove cloned branch
50
56
if : ${{ always() }}
51
57
shell : bash
52
- run : ' rm -rf $BRANCH_DIR'
58
+ run : ' rm -rf " $BRANCH_DIR" '
You can’t perform that action at this time.
0 commit comments