{"id":18837286,"url":"https://github.com/clarenceb/securefile-upload","last_synced_at":"2026-01-28T01:30:16.266Z","repository":{"id":142072093,"uuid":"265414879","full_name":"clarenceb/securefile-upload","owner":"clarenceb","description":"Azure DevOps SecureFile upload from CLI example","archived":false,"fork":false,"pushed_at":"2023-04-27T14:05:12.000Z","size":8,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T08:40:53.936Z","etag":null,"topics":["azuredevops","cli","example","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clarenceb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-20T01:31:31.000Z","updated_at":"2020-05-20T02:33:02.000Z","dependencies_parsed_at":"2023-07-09T05:31:56.347Z","dependency_job_id":null,"html_url":"https://github.com/clarenceb/securefile-upload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarenceb%2Fsecurefile-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarenceb%2Fsecurefile-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarenceb%2Fsecurefile-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clarenceb%2Fsecurefile-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clarenceb","download_url":"https://codeload.github.com/clarenceb/securefile-upload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239774324,"owners_count":19694700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azuredevops","cli","example","typescript"],"created_at":"2024-11-08T02:34:40.063Z","updated_at":"2026-01-28T01:30:16.203Z","avatar_url":"https://github.com/clarenceb.png","language":"TypeScript","readme":"How to upload SecureFile to Azure Pipelines from CLI\n====================================================\n\nThis is just a demo with no error handling for is illustrative purposes only.\n\nPrequisities\n------------\n\n* Node and NPM installed\n* Bash shell\n* Create an Azure DevOps Organization\n* Create an Azure DevOps Project\n* Create a PAT for your Azure DevOps user with appropriate access\n\nUsage with Bash shell\n---------------------\n\n```sh\nnpm install -g typescript\nnpm install\n\nTOKEN=\"\u003cYOUR_PERSOANL_ACCESS_TOKEN\u003e\"\nORG=\"https://dev.azure.com/\u003cyour_orgname\u003e\"\nPROJECT=\"\u003cyour_project_name\u003e\"\n\ntsc uploadSecureFile.ts\n\n# Create a demo file to upload (or use a real file you want to upload)\nls -1 \u003e demofile.txt\nzip demofile.zip demofile.txt\n\n# Upload secret file with same basename (demofile.zip)\nnode uploadSecureFile.js ./demofile.zip\n\n# Upload secret file with custom name (something.zip)\nnode uploadSecureFile.js ./demofile.zip something.zip\n```\n\nYour secure file will be in under **Pipelines** / **Library** / **Secure files** for your project.\n\nTesting the secret file\n-----------------------\n\nIn Azure Pipelines you can use the [Download Secure File Task](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-secure-file) to retrieve the secret.\n\ne.g. in YAML\n\n```yaml\n- task: DownloadSecureFile@1\n  name: mysecret\n  displayName: 'Download My Secret'\n  inputs:\n    secureFile: 'something.zip'\n\n- script: |\n    echo Do somethign usefule with the secret...\n    ls -lah $(mysecret.secureFilePath)\n    file $(mysecret.secureFilePath)\n    unzip -t $(mysecret.secureFilePath)\n```\n\nYou can also use Classic Build/Release Tasks to download secret files.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclarenceb%2Fsecurefile-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclarenceb%2Fsecurefile-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclarenceb%2Fsecurefile-upload/lists"}