@@ -572,6 +572,81 @@ skills:
572572 status : ' active'
573573 skills : ['self-hosting']
574574
575+ - name : ' Use GitHub Action'
576+ slug : ' gh-action'
577+ domain : ' integration'
578+ description : ' Use the "Preview in LiveCodes" GitHub Action to generate preview playground links for pull request code changes'
579+ type : ' composition'
580+ covers :
581+ - ' Workflow file setup (livecodes-preview.yml)'
582+ - ' Comment workflow (livecodes-post-comment.yml)'
583+ - ' Playground configuration JSON files'
584+ - ' Dynamic values (LC::REF, LC::SHA, etc.)'
585+ - ' File placeholders (TO_URL, TO_DATA_URL)'
586+ - ' Deploy preview strategies'
587+ tasks :
588+ - ' Set up GitHub Action workflow'
589+ - ' Configure playground JSON files'
590+ - ' Use dynamic values in configurations'
591+ - ' Link deployed assets to playgrounds'
592+ failure_modes :
593+ - mistake : ' Workflow files not on default branch'
594+ mechanism : ' GitHub Actions workflow_run event requires workflow files to be on default branch before PRs can trigger them'
595+ wrong_pattern : |
596+ # Creating PR with workflow files in same PR
597+ # Action won't run until merged to default branch
598+ correct_pattern : |
599+ # First merge workflow files to default branch
600+ git checkout main
601+ git merge feature/add-gh-action
602+ git push
603+ # Now PRs can trigger the action
604+ source : ' GitHub Actions documentation on workflow_run event'
605+ priority : ' HIGH'
606+ status : ' active'
607+ skills : ['gh-action']
608+
609+ - mistake : ' Missing permissions for PR comments'
610+ mechanism : ' Comment workflow needs pull-requests: write permission to post comments'
611+ wrong_pattern : |
612+ jobs:
613+ upload:
614+ runs-on: ubuntu-latest
615+ # Missing permissions!
616+ correct_pattern : |
617+ jobs:
618+ upload:
619+ runs-on: ubuntu-latest
620+ permissions:
621+ pull-requests: write # Required!
622+ source : ' GitHub Actions permissions'
623+ priority : ' MEDIUM'
624+ status : ' active'
625+ skills : ['gh-action']
626+
627+ - mistake : ' Using data URLs for large files'
628+ mechanism : ' Data URLs stored at dpaste.com have 1M character limit; large builds will fail'
629+ wrong_pattern : |
630+ {
631+ "imports": {
632+ "my-lib": "{{LC::TO_DATA_URL(./dist/bundle.js)}}" // Too large!
633+ }
634+ }
635+ correct_pattern : |
636+ # Use base-url and TO_URL for large files
637+ # In workflow:
638+ base-url: "https://{{LC::REF}}.my-project.pages.dev"
639+ # In project JSON:
640+ {
641+ "imports": {
642+ "my-lib": "{{LC::TO_URL(./dist/bundle.js)}}"
643+ }
644+ }
645+ source : ' Action: dpaste.com limits'
646+ priority : ' MEDIUM'
647+ status : ' active'
648+ skills : ['gh-action']
649+
575650 - name : ' Import and Export Code'
576651 slug : ' import-export'
577652 domain : ' configuration'
0 commit comments