File tree Expand file tree Collapse file tree 10 files changed +987
-67
lines changed Expand file tree Collapse file tree 10 files changed +987
-67
lines changed Original file line number Diff line number Diff line change 1+ name : Deno Outdated Check
2+ description : ' Check for outdated Deno dependencies and display them in PR comments'
3+
4+ inputs :
5+ directory :
6+ description : ' Directory where to run the deno outdated check'
7+ required : true
8+ title :
9+ description : ' Message title'
10+ required : true
11+
12+ outputs :
13+ result :
14+ description : ' Result of the outdated check'
15+ value : ${{ steps.outdated.outputs.result }}
16+
17+ runs :
18+ using : " composite"
19+ steps :
20+ - uses : denoland/setup-deno@v2
21+ with :
22+ deno-version : v2.x
23+
24+ - name : Outdated packages - check
25+ id : outdated
26+ shell : bash
27+ working-directory : ${{ inputs.directory }}
28+ run : |
29+ cat deno.json
30+ bash ${{ github.workspace }}/.github/action/deno-outdated/deno-outdated.sh
31+
32+ - name : ' Outdated packages - post'
33+ uses : marocchino/sticky-pull-request-comment@v2
34+ with :
35+ recreate : true
36+ header : " outdated_${{ inputs.title }}"
37+ message : |
38+ ### ${{ inputs.title }}
39+ ${{ steps.outdated.outputs.result }}
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e # Exit on error
4+ set -u # Exit on undefined variable
5+
6+ TMP_FILE=" outdated_$( date +%s) _$$ .md"
7+
8+ # Check for outdated dependencies with recursive flag (removed quiet flag to show all outdated dependencies)
9+ OUTDATED=" $( deno outdated -r) "
10+ echo " $OUTDATED "
11+
12+ # If no outdated dependencies are found, output "none", otherwise format the output
13+ if [ -z " $OUTDATED " ]; then
14+ echo " none" > " $TMP_FILE "
15+ else
16+ # Make sure the format-markdown.sh file is executable
17+ chmod +x " $( dirname " $0 " ) /markdown/format-markdown.sh"
18+
19+ # Use the format-markdown.sh script to convert the output to markdown
20+ echo " $OUTDATED " | " $( dirname " $0 " ) /markdown/format-markdown.sh" > " $TMP_FILE "
21+ fi
22+
23+ # If running in GitHub Actions, add the result to GitHub Actions output
24+ if [ -n " $GITHUB_OUTPUT " ]; then
25+ {
26+ echo " result<<EOF"
27+ cat " $TMP_FILE "
28+ echo " EOF"
29+ rm " $TMP_FILE "
30+ } >> " $GITHUB_OUTPUT "
31+ else
32+ echo " Outdated dependencies:"
33+ cat " $TMP_FILE "
34+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e # Exit on error
4+ set -u # Exit on undefined variable
5+
6+ # Get the directory of the current script
7+ SCRIPT_DIR=" $( dirname " $0 " ) "
8+
9+ # Make sure the awk script is executable
10+ chmod +x " $SCRIPT_DIR /format-table.awk"
11+
12+ # Remove ANSI color codes from the output and convert to markdown table format using the external awk script
13+ sed -r ' s/\x1B\[[0-9;]*[mK]//g' | " $SCRIPT_DIR /format-table.awk"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e # Exit on error
4+ set -u # Exit on undefined variable
5+
6+ # Create a sample ASCII table similar to the output of `deno outdated`
7+ SAMPLE_TABLE=" ┌───────────────────────────┬─────────┬─────────┬───────────────┐
8+ │ Package │ Current │ Update │ Latest │
9+ ├───────────────────────────┼─────────┼─────────┼───────────────┤
10+ │ jsr:@supabase/supabase-js │ 2.49.8 │ 2.49.8 │ 2.49.9-next.2 │
11+ ├───────────────────────────┼─────────┼─────────┼───────────────┤
12+ │ npm:lucide-react │ 0.484.0 │ 0.484.0 │ 0.511.0 │
13+ ├───────────────────────────┼─────────┼─────────┼───────────────┤
14+ │ npm:react │ 19.0.0 │ 19.0.0 │ 19.1.0 │
15+ └───────────────────────────┴─────────┴─────────┴───────────────┘"
16+
17+ # Expected markdown output
18+ EXPECTED_OUTPUT=" Package|Current|Update|Latest
19+ ---|---|---|---
20+ jsr:@supabase/supabase-js|2.49.8|2.49.8|2.49.9-next.2
21+ npm:lucide-react|0.484.0|0.484.0|0.511.0
22+ npm:react|19.0.0|19.0.0|19.1.0"
23+
24+ # Run the format-markdown.sh script on the sample table
25+ ACTUAL_OUTPUT=$( echo " $SAMPLE_TABLE " | " $( dirname " $0 " ) /format-markdown.sh" )
26+
27+ # Compare the actual output with the expected output
28+ if [ " $ACTUAL_OUTPUT " = " $EXPECTED_OUTPUT " ]; then
29+ echo " Test passed! The format-markdown.sh script produces the expected output."
30+ else
31+ echo " Test failed! The format-markdown.sh script does not produce the expected output."
32+ echo " Expected:"
33+ echo " $EXPECTED_OUTPUT "
34+ echo " Actual:"
35+ echo " $ACTUAL_OUTPUT "
36+ exit 1
37+ fi
Original file line number Diff line number Diff line change 1+ #!/usr/bin/awk -f
2+
3+ BEGIN { FS = " │" ; OFS = " |" }
4+
5+ # Skip separator lines
6+ /^ ┌| ^ └| ^ ├ / { next }
7+
8+ # Process table rows
9+ /^ │ / {
10+ # Remove leading and trailing │ and spaces
11+ gsub (/^ │| │$ /, " " );
12+
13+ # Convert each cell by trimming spaces
14+ for (i= 1 ; i<= NF ; i++ ) {
15+ gsub (/^ [[:space :] ]+ | [[:space :] ]+ $ /, " " , $i);
16+ }
17+
18+ # Print as markdown table row with proper column alignment
19+ # Skip the first empty column if it exists
20+ if ($1 == " " ) {
21+ print $2 OFS $3 OFS $4 OFS $5 ;
22+ } else {
23+ print $1 OFS $2 OFS $3 OFS $4 ;
24+ }
25+
26+ # Add header separator after the first data row
27+ if (NR == 2 ) {
28+ print " ---|---|---|---" ;
29+ }
30+ }
Original file line number Diff line number Diff line change 1- name : Check Supabase
1+ name : PR: Supabase
22
33on :
44 pull_request :
88 - synchronize
99 - ready_for_review
1010 paths :
11- - " .github/workflows/test-supabase.yml"
11+ - " .github/workflows/pr-supabase.yml"
12+ - " deno.lock"
1213 - " supabase/**"
1314 - " !**.md"
1415 workflow_dispatch :
1516
17+ permissions :
18+ pull-requests : write
19+
1620env :
1721 PROJECT_ID : xxx
1822 PROJECT_PUBLISHABLE_KEY : yyy
1923
2024jobs :
2125 qa :
26+ name : ' QA'
2227 environment : test
2328 runs-on : ubuntu-latest
2429 steps :
2530 - uses : actions/checkout@v4
31+ with :
32+ ref : ${{ github.event.pull_request.head.sha }}
2633 - uses : denoland/setup-deno@v2
2734 with :
2835 deno-version : v2.x
3643 with :
3744 name : cron_jobs.sql
3845 path : cron_jobs.sql
39- retention-days : 1
46+ retention-days : 1
47+
48+ - name : ' Check Outdated Packages'
49+ uses : ./.github/action/deno-outdated
50+ id : outdated_supabase
51+ with :
52+ directory : ./supabase/functions
53+ title : ' Deno Outdated - Supabase'
Original file line number Diff line number Diff line change 1+ name : PR:Web
2+
3+ on :
4+ pull_request :
5+ types :
6+ - opened
7+ - reopened
8+ - synchronize
9+ - ready_for_review
10+ paths :
11+ - " .github/workflows/pr-web.yml"
12+ - " src/web/**"
13+ - " !**.md"
14+ workflow_dispatch :
15+
16+ permissions :
17+ pull-requests : write
18+
19+ jobs :
20+ qa :
21+ name : ' QA'
22+ environment : test
23+ runs-on : ubuntu-latest
24+ defaults :
25+ run :
26+ working-directory : src/web
27+
28+ steps :
29+ - uses : actions/checkout@v4
30+ with :
31+ ref : ${{ github.event.pull_request.head.sha }}
32+ - uses : denoland/setup-deno@v2
33+ with :
34+ deno-version : v2.x
35+
36+ - run : deno fmt --check
37+ - run : deno lint
38+
39+ - name : ' Build the app'
40+ run : deno task build
41+
42+ - name : ' Upload artifact'
43+ uses : actions/upload-pages-artifact@v3
44+ with :
45+ path : ./src/web/dist
46+
47+ - name : ' Check Outdated packages'
48+ uses : ./.github/action/deno-outdated
49+ with :
50+ directory : ./src/web
51+ title : ' Deno Outdated - Web'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -27,6 +27,5 @@ dist-ssr
2727
2828# custom
2929supabase /functions /.env
30- deno.lock
3130.env
3231cron_jobs.sql
You can’t perform that action at this time.
0 commit comments