Skip to content

Commit c50d333

Browse files
Merge pull request #151 from deriv-com/test-link-bundle
Prince/ bundle generator
2 parents e951688 + 7714a2a commit c50d333

File tree

7 files changed

+123
-429
lines changed

7 files changed

+123
-429
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Generate Bundle CDN URL
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
pull-requests: write # Ensure the token has write access to PRs
9+
10+
jobs:
11+
generate-url:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '18'
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Generate CDN URL
26+
id: generate-url
27+
run: |
28+
# Generate the URL and capture it as an output
29+
URL=$(node scripts/generate-bundle-url.js)
30+
echo "URL=$URL" >> $GITHUB_ENV
31+
32+
- name: Create or update PR comment with CDN URL
33+
uses: peter-evans/create-or-update-comment@v3
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
issue-number: ${{ github.event.pull_request.number }}
37+
body: |
38+
### CUSTOM FOOTER SCRIPT
39+
40+
${{ env.URL }}
41+

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
npm run pre-commit:generate-bundle

0 commit comments

Comments
 (0)