Skip to content

Commit b108cfd

Browse files
committed
chore: updated workflow + removed env var from command
1 parent 736dbf6 commit b108cfd

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

Diff for: .github/workflows/measure-packages-size.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,26 @@ jobs:
1414
NODE_ENV: dev
1515
PR_NUMBER: ${{ inputs.prNumber }}
1616
steps:
17+
# Since we are manually triggering the workflow the previous checkout has the main branch. In order to checkout the branch/code of the PR
18+
# we need first to use the PR number to retrieve the PR SHA number. This means we need three steps to: checkout the repo,
19+
# run a custom script to get the SHA, and then finally checkout the PR branch
1720
- name: Checkout Repo
1821
uses: actions/checkout@v3
22+
- name: Extract PR details
23+
id: extract_PR_details
24+
uses: actions/github-script@v6
25+
with:
26+
script: |
27+
const script = require('.github/scripts/get_pr_info.js');
28+
await script({github, context, core});
29+
- name: Checkout PR code
30+
uses: actions/checkout@v3
31+
with:
32+
ref: ${{ steps.extract_PR_details.outputs.headSHA }}
1933
- name: Packages size report
2034
uses: flochaz/[email protected]
2135
with:
22-
build-command: mkdir dist && npm run package -w packages/logger -w packages/tracer -w packages/metrics && npm run package-bundle -w packages/logger -w packages/tracer -w packages/metrics && bash -c "mv ./packages/*/dist/* dist/" && ls dist
36+
build-command: mkdir dist && npm run package -w packages/logger -w packages/tracer -w packages/metrics -w packages/commons && npm run package-bundle -w packages/logger -w packages/tracer -w packages/metrics -w packages/commons && bash -c "mv ./packages/*/dist/* dist/" && ls dist
2337
dist-directory: /dist
2438
pr-number: ${{ inputs.prNumber }}
2539
env:

Diff for: packages/commons/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",
2020
"format": "eslint --fix --ext .ts --fix --no-error-on-unmatched-pattern src tests",
2121
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
22-
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/",
22+
"package-bundle": "../../package-bundler.sh commons-bundle ./dist",
2323
"prepare": "npm run build",
2424
"prepublishOnly": "npm test && npm run lint",
2525
"preversion": "npm run lint",
@@ -48,4 +48,4 @@
4848
"serverless",
4949
"nodejs"
5050
]
51-
}
51+
}

Diff for: packages/logger/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",
2323
"format": "eslint --fix --ext .ts --fix --no-error-on-unmatched-pattern src tests",
2424
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
25-
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/",
25+
"package-bundle": "../../package-bundler.sh logger-bundle ./dist",
2626
"prepare": "npm run build",
2727
"prepublishOnly": "npm test && npm run lint",
2828
"preversion": "npm run lint",
@@ -64,4 +64,4 @@
6464
"serverless",
6565
"nodejs"
6666
]
67-
}
67+
}

Diff for: packages/metrics/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",
2323
"format": "eslint --fix --ext .ts --fix --no-error-on-unmatched-pattern src tests",
2424
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
25-
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/",
25+
"package-bundle": "../../package-bundler.sh metrics-bundle ./dist",
2626
"prepare": "npm run build",
2727
"prepublishOnly": "npm test && npm run lint",
2828
"preversion": "npm run lint",
@@ -59,4 +59,4 @@
5959
"serverless",
6060
"nodejs"
6161
]
62-
}
62+
}

Diff for: packages/tracer/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"version": "npm run format && git add -A src",
2828
"postversion": "git push && git push --tags",
2929
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
30-
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/"
30+
"package-bundle": "../../package-bundler.sh tracer-bundle ./dist"
3131
},
3232
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/tracer#readme",
3333
"license": "MIT-0",
@@ -62,4 +62,4 @@
6262
"serverless",
6363
"nodejs"
6464
]
65-
}
65+
}

0 commit comments

Comments
 (0)