-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Biz/dj 2899 create a GitHub action to upsert any changed app files into #15614
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
Merged
bzwrk
merged 30 commits into
master
from
biz/dj-2899-create-a-github-action-to-upsert-any-changed-app-files-into
Feb 14, 2025
+46,136
−8
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d44dda8
Add new action
bzwrk 1fbbe94
Touch a file
bzwrk 36569ca
Change trigger type
bzwrk 8ff4502
Remove unnecessary arguments from the action
bzwrk 6999a39
Fix path
bzwrk 05fb452
Fix path
bzwrk b3e41f2
Fix path
bzwrk bb6f368
Add dist directory
bzwrk d29a860
Add license
bzwrk f331971
Add lock file
bzwrk ad3f8e1
Add index and package.json
bzwrk 794a23e
Touch file
bzwrk dbaaa9b
Process changed files and push to supabase
bzwrk 783c0a2
Add supabase key requirement
bzwrk 0854a39
Debug
bzwrk 0dca7a4
Update index.js
bzwrk 81b433e
Update index.js
bzwrk 9def150
Update index.js
bzwrk 487fca6
Update index.js
bzwrk d3dfe93
Update index.js
bzwrk 2a96fb4
Update index.js
bzwrk 65ca9c4
Update index.js
bzwrk 82d484d
Update index.js
bzwrk 6877f35
Update index.js
bzwrk a9370ab
Update index.js
bzwrk be06c50
Cleanup
bzwrk 659412d
Update README.md
bzwrk 47195bc
Update workflow file
bzwrk 964b1a1
Use supabase uri from env
bzwrk 4e03c04
Set action node version to 20
bzwrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
.github/actions/push-registry-app-files-supabase/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Push registry app files to Supabase | ||
|
|
||
| This action pushes new and modified `*.app.mjs/*.app.ts` files to Supabase. | ||
|
|
||
| ## Inputs | ||
|
|
||
| ### `changed_files` | ||
|
|
||
| **Required** List of changed files. | ||
|
|
||
| ### `supabase_anon_key` | ||
|
|
||
| **Required** Supabase key | ||
|
|
||
| ``` | ||
| ... | ||
| with: | ||
| format: json | ||
| ``` | ||
|
|
||
| in that way `steps.changed_files.outputs.all` will be converted into an array of strings | ||
|
|
||
| ## Example usage | ||
|
|
||
| ```yaml | ||
| - name: Upload modified or newly added *.app.mjs files to Supabase | ||
| uses: ./.github/actions/push-registry-app-files-supabase | ||
| with: | ||
| changed_files: ${{ steps.changed_files.outputs.all }} | ||
| supabase_anon_key: ${{ secrets.SUPABASE_ANON_KEY }} | ||
| ``` | ||
|
|
||
| ## Local Development + Build | ||
|
|
||
| Run the following command from this action directory to update `dist/index.js` if `src/index.js` has been modified: | ||
| ```bash | ||
| cd .github/actions/push-registry-app-files-supabase | ||
| npm run dev | ||
| ``` | ||
|
|
||
| The above command will build and run the dist/index.js. Commit the `dist` directory. | ||
| You might want to change the `on` trigger to `push` event on your local branch when making changes to the action so you | ||
| can test it on GitHub: | ||
|
|
||
| ## Master | ||
| ```yaml | ||
| # .github/workflows/push-registry-app-files-supabase.yaml | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - 'components/**' | ||
| ``` | ||
|
|
||
| ## During development | ||
| ```yaml | ||
| # .github/workflows/push-registry-app-files-supabase.yaml | ||
| on: | ||
| push: | ||
| branches: | ||
| - feature-branch-name | ||
| paths: | ||
| - 'components/**' | ||
| - '.github/actions/push-registry-app-files-supabase/**' | ||
| ``` | ||
|
|
||
15 changes: 15 additions & 0 deletions
15
.github/actions/push-registry-app-files-supabase/action.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: "Push registry app files to Supabase" | ||
| description: "Push registry app files that have changed to Supabase. If any *app.ts files have changed, run pnpm build for the affected app to generate the *.app.mjs file." | ||
| inputs: | ||
| changed_files: | ||
| description: "List of all changed files coming from the push_to_supabase job of a github action workflow" | ||
| required: true | ||
| supabase_anon_key: | ||
| description: "Supabase anon key" | ||
| required: true | ||
| supabase_uri: | ||
| description: "Supabase URI" | ||
| required: true | ||
| runs: | ||
| using: "node20" | ||
| main: "dist/index.js" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specifier to the code block.
The code block is missing a language specifier, which affects syntax highlighting and documentation consistency.
Apply this diff:
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
15-15: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)