Skip to content

Commit

Permalink
Merge pull request #151 from deriv-com/test-link-bundle
Browse files Browse the repository at this point in the history
Prince/ bundle generator
  • Loading branch information
ali-hosseini-deriv authored Sep 19, 2024
2 parents e951688 + 7714a2a commit c50d333
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 429 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/generate-bundle-url.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Generate Bundle CDN URL

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
pull-requests: write # Ensure the token has write access to PRs

jobs:
generate-url:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Generate CDN URL
id: generate-url
run: |
# Generate the URL and capture it as an output
URL=$(node scripts/generate-bundle-url.js)
echo "URL=$URL" >> $GITHUB_ENV
- name: Create or update PR comment with CDN URL
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
### CUSTOM FOOTER SCRIPT
${{ env.URL }}
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

npm run pre-commit:generate-bundle
Loading

0 comments on commit c50d333

Please sign in to comment.