File tree Expand file tree Collapse file tree 2 files changed +45
-2
lines changed Expand file tree Collapse file tree 2 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 1+ name : generate
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 * * *'
6+ workflow_dispatch :
7+
8+ jobs :
9+ run :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Setup PHP
14+ uses : shivammathur/setup-php@v2
15+ with :
16+ php-version : ' 8.0'
17+
18+ - name : Checkout
19+ uses : actions/checkout@v2
20+
21+ - name : Generate
22+ run : make
23+
24+ - name : Count changes
25+ id : changes
26+ run : |
27+ git add -N .
28+ echo "::set-output name=count::$(git diff --name-only | wc -l)"
29+
30+ - name : Create Pull Request
31+ uses : peter-evans/create-pull-request@v3
32+ with :
33+ commit-message : Update Error Code
34+ delete-branch : true
35+ title : Update Error Code
36+ body : |
37+ Error codes have been updated.
38+
39+ - https://github.com/postgres/postgres/blob/master/src/backend/utils/errcodes.txt
40+ if : ${{ steps.changes.outputs.count > 0 }}
Original file line number Diff line number Diff line change 44$ const = array ();
55
66while ($ row = fgets (STDIN )) {
7- if (preg_match ('/^([0-9A-Z]{5}) +[SWE] +[^ ]+? +([a-z_]+)$/ ' , $ row , $ matches )) {
7+ if (preg_match ('/^Section: (Class .*)$/ ' , $ row , $ matches )) {
8+ $ const [] = '' ;
9+ $ const [] = " // {$ matches [1 ]}" ;
10+ } elseif (preg_match ('/^([0-9A-Z]{5}) +[SWE] +[^ ]+? +([a-z_]+)$/ ' , $ row , $ matches )) {
811 $ key = strtoupper ($ matches [2 ]);
912 if (isset ($ codes [$ key ])) {
1013 $ key .= '_EXCEPTION ' ;
1417 }
1518}
1619
17- $ const = implode (PHP_EOL , $ const );
20+ $ const = trim ( implode (PHP_EOL , $ const), PHP_EOL );
1821
1922echo <<<EOD
2023<?php
You can’t perform that action at this time.
0 commit comments