changing linefeed
This commit is contained in:
parent
006ac980dc
commit
621d3b0e4c
@ -1,47 +1,48 @@
|
|||||||
name: Upload artifact With Ftp
|
name: Upload artifact With Ftp
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
artifactName:
|
artifactName:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
fileName:
|
fileName:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
uploadName:
|
uploadName:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
ftpPath:
|
ftpPath:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
txtFileContent:
|
txtFileContent:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
txtFileName:
|
txtFileName:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
jobs:
|
jobs:
|
||||||
UploadFtp:
|
UploadFtp:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Load Artifact
|
- name: Load Artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifactName }}
|
name: ${{ inputs.artifactName }}
|
||||||
path: ./
|
path: ./
|
||||||
- name: Upload
|
- name: Upload
|
||||||
run: |
|
run: |
|
||||||
upload_name=${{ inputs.fileName }}
|
upload_name=${{ inputs.fileName }}
|
||||||
|
|
||||||
if [ "${{ inputs.uploadName }}" != "" ]; then
|
if [ "${{ inputs.uploadName }}" != "" ]; then
|
||||||
echo "Renaming file to ${{ inputs.uploadName }}"
|
echo "Renaming file to ${{ inputs.uploadName }}"
|
||||||
mv ${{ inputs.fileName }} ${{ inputs.uploadName }}
|
mv ${{ inputs.fileName }} ${{ inputs.uploadName }}
|
||||||
upload_name=${{ inputs.uploadName }}
|
upload_name=${{ inputs.uploadName }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -T ./$upload_name ${{ vars.FTP_SERVER_URL }}${{ inputs.ftpPath }} --user "${{ vars.FTP_USER }}:${{ vars.FTP_PASSWORD }}"
|
curl -T ./$upload_name ${{ vars.FTP_SERVER_URL }}${{ inputs.ftpPath }} --user "${{ vars.FTP_USER }}:${{ vars.FTP_PASSWORD }}"
|
||||||
|
|
||||||
if [ "${{ inputs.txtFileName }}" != "" ]; then
|
if [ "${{ inputs.txtFileName }}" != "" ]; then
|
||||||
printf "%b" "${{ inputs.txtFileContent }}" > ${{ inputs.txtFileName }}
|
printf "%b" "${{ inputs.txtFileContent }}" > ${{ inputs.txtFileName }}
|
||||||
curl -T ./${{ inputs.txtFileName }} ${{ vars.FTP_SERVER_URL }}${{ inputs.ftpPath }} --user "${{ vars.FTP_USER }}:${{ vars.FTP_PASSWORD }}"
|
curl -T ./${{ inputs.txtFileName }} ${{ vars.FTP_SERVER_URL }}${{ inputs.ftpPath }} --user "${{ vars.FTP_USER }}:${{ vars.FTP_PASSWORD }}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user