Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prince/ bundle generator #151

Merged
merged 22 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading