Skip to content

Commit

Permalink
v13, handle spaces in app names
Browse files Browse the repository at this point in the history
  • Loading branch information
Einar Egilsson committed Sep 24, 2020
1 parent 4242484 commit a4e077d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: zip -r deploy.zip . -x '*.git*'

- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v12
uses: einaregilsson/beanstalk-deploy@v13
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -48,7 +48,7 @@ attempt to deploy that. In the example below the action would attempt do deploy

```yaml
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v12
uses: einaregilsson/beanstalk-deploy@v13
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
10 changes: 7 additions & 3 deletions aws-api-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ function awsApiRequest(options) {
return stringToSign;
}

function createCanonicalRequest(method, uri, querystring, headers, payload) {
function createCanonicalRequest(method, path, querystring, headers, payload) {
let canonical = method + '\n';
canonical += encodeURI(encodeURI(uri)) + '\n';

//Changed this from double encoding the path to single encoding it, to make S3 paths with spaces work. However, the documentation said to
//double encode it...? The only time we actually encode a path other than / is when uploading to S3 so just change this to single encoding here
//but it's possible it will mess up if the path has some weird characters that should be double encoded maybe??? If you had weird symbols in your version number?
canonical += encodeURI(path) + '\n';

let qsKeys = Object.keys(querystring);
qsKeys.sort();
Expand Down Expand Up @@ -100,7 +104,7 @@ function awsApiRequest(options) {
reqHeaders.Authorization = authHeader;

//Now, lets finally do a HTTP REQUEST!!!
request(method, path, reqHeaders, querystring, payload, (err, result) => {
request(method, encodeURI(path), reqHeaders, querystring, payload, (err, result) => {
if (err) {
reject(err);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beanstalk-deploy",
"version": "12.0.0",
"version": "13.0.0",
"description": "GitHub Action + command line tool to deploy to AWS Elastic Beanstalk.",
"main": "beanstalk-deploy.js",
"scripts": {
Expand Down

0 comments on commit a4e077d

Please sign in to comment.