File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
.github/actions/deploy-dir-as-branch Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1111 - name : Creating temporary directory to clone the branch
1212 shell : bash
1313 run : |
14- BRANCH_DIR=$(mktemp -d "`pwd`/cloned_${{ inputs.target_branch }}_XXXXXX ")
14+ BRANCH_DIR=$(mktemp -d "`pwd`/$BRANCH_DIR_TEMPLATE ")
1515 echo "BRANCH_DIR=$BRANCH_DIR" >> $GITHUB_ENV
16+ env :
17+ BRANCH_DIR_TEMPLATE : ' cloned_${{ inputs.target_branch }}_XXXXXX'
1618
1719 - name : Checkout `${{ inputs.target_branch }}` branch
1820 uses : actions/checkout@v2
3133 echo '::endgroup::'
3234
3335 echo '::group::Move necessary files'
34- cp -vnR '${{ github.workspace }}/${{ inputs.src_dir }}/.' .
36+ cp -vnR "$SRC_DIR/." .
3537 echo '::endgroup::'
3638
3739 git add -A
@@ -41,12 +43,16 @@ runs:
4143 git config user.name 'GitHub Action Script'
4244 git config user.email '[email protected] ' 4345
44- git commit -a -m ' Deploy ${{ github.sha }} to '${{ inputs.target_branch }} ' branch'
46+ git commit -a -m " Deploy $SHA to '$TARGET_BRANCH ' branch"
4547 git push
4648 echo 'Pushed'
4749 fi
50+ env :
51+ SRC_DIR : ' ${{ github.workspace }}/${{ inputs.src_dir }}'
52+ SHA : ${{ github.sha }}
53+ TARGET_BRANCH : ${{ inputs.target_branch }}
4854
4955 - name : Remove cloned branch
5056 if : ${{ always() }}
5157 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