Skip to content

Commit

Permalink
Merge branch 'master' into issues/14577
Browse files Browse the repository at this point in the history
  • Loading branch information
timothy-volvo authored Apr 24, 2021
2 parents 90e797a + 923a354 commit 135498a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/localization-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'LEGO automerge'

on:
pull_request:
types:
- opened
branches:
- Localization

jobs:
worker:
runs-on: ubuntu-latest

if: github.actor == 'csigs'
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.pulls.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
merge_method: 'squash'
})
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"loc.messages.Disconnected": "disconnected",
"loc.messages.DisconnectHost": "disconnecting from: %s",
"loc.messages.FTPConnected": "connected: %s",
"loc.messages.InvalidFTPOptions": "There was an error when reading FTP options: %s",
"loc.messages.FTPNoHostSpecified": "The FTP server URL must include a host name",
"loc.messages.FTPNoProtocolSpecified": "The FTP server URL must begin with ftp:// or ftps://",
"loc.messages.NoFilesFound": "Could not find any files to upload",
Expand Down
8 changes: 7 additions & 1 deletion Tasks/FtpUploadV2/ftpuploadtask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ async function run() {
tl.setResourcePath(path.join(__dirname, "task.json"));

const tries = 3;
const ftpOptions: FtpOptions = getFtpOptions();
let ftpOptions: FtpOptions;
try {
ftpOptions = getFtpOptions();
} catch (err) {
tl.setResult(tl.TaskResult.Failed, tl.loc('InvalidFTPOptions', err));
return;
}

if (!ftpOptions.serverEndpointUrl.protocol) {
tl.setResult(tl.TaskResult.Failed, tl.loc("FTPNoProtocolSpecified"));
Expand Down
5 changes: 3 additions & 2 deletions Tasks/FtpUploadV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"version": {
"Major": 2,
"Minor": 186,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "2.182.1",
"instanceNameFormat": "FTP Upload: $(rootFolder)",
Expand Down Expand Up @@ -195,6 +195,7 @@
"Disconnected": "disconnected",
"DisconnectHost": "disconnecting from: %s",
"FTPConnected": "connected: %s",
"InvalidFTPOptions": "There was an error when reading FTP options: %s",
"FTPNoHostSpecified": "The FTP server URL must include a host name",
"FTPNoProtocolSpecified": "The FTP server URL must begin with ftp:// or ftps://",
"NoFilesFound": "Could not find any files to upload",
Expand All @@ -203,4 +204,4 @@
"UploadSucceedRes": "FTP upload successful",
"UploadFailed": "Ftp Upload failed"
}
}
}
3 changes: 2 additions & 1 deletion Tasks/FtpUploadV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"version": {
"Major": 2,
"Minor": 186,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "2.182.1",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down Expand Up @@ -195,6 +195,7 @@
"Disconnected": "ms-resource:loc.messages.Disconnected",
"DisconnectHost": "ms-resource:loc.messages.DisconnectHost",
"FTPConnected": "ms-resource:loc.messages.FTPConnected",
"InvalidFTPOptions": "ms-resource:loc.messages.InvalidFTPOptions",
"FTPNoHostSpecified": "ms-resource:loc.messages.FTPNoHostSpecified",
"FTPNoProtocolSpecified": "ms-resource:loc.messages.FTPNoProtocolSpecified",
"NoFilesFound": "ms-resource:loc.messages.NoFilesFound",
Expand Down

0 comments on commit 135498a

Please sign in to comment.