From 6028d2a9e7b6168518e8c89c39f6c2290ae170cb Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 17:52:15 -0700 Subject: [PATCH 01/24] fix suggestions from codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 60 ++++++++++++++++++ .github/workflows/workflow.yml | 27 ++++++++ .../controller/FileUploadController.java | 7 +- .../spring/controller/PDFhighlightDemo.java | 9 +-- .../controller/FileUploadController.class | Bin 4867 -> 4956 bytes .../spring/controller/PDFhighlightDemo.class | Bin 5492 -> 5190 bytes 6 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/aws-codeguru-reviewer.yml create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml new file mode 100644 index 0000000..55a8740 --- /dev/null +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -0,0 +1,60 @@ +version: 1.0 + +# Sample YAML file +# This configuration file is an optional file for Amazon CodeGuru Reviewer. +# You must name your file aws-codeguru-reviewer.yml for CodeGuru Reviewer to recognize it. +# Add the file to the root directory of your repository. +# For more information, see the Amazon CodeGuru Reviewer User Guide: +# https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/welcome.html. + +# Exclude files and directories +# Use glob pattern syntax to specify the files and directories that you want to exclude +# from analysis under excludeFiles. For more information, see glob (programming): +# https://en.wikipedia.org/wiki/Glob_(programming). +# The following example excludes from analysis all content in the some-package directory, all content +# in the tst directory, and all JSON files in a sub-directory under a directory prefixed with some-. +# Replace with your own list of files and directories that you want CodeGuru Reviewer to exclude. +# We recommend that you use a schema validator to confirm that the YAML syntax is valid. + +excludeFiles: + - 'src/some-package/**' + - 'tst/**' + - 'src/some-*/**/*.json' + +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # This is a required field for CodeGuru + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 + aws-region: us-east-1 + - name: CodeGuru Reviewer + uses: aws-actions/codeguru-reviewer@v1.1 + with: + s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix + - name: Upload review result + if: ${{ github.event_name != 'push' }} + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: codeguru-results.sarif.json + diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..402623d --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,27 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # This is a required field for CodeGuru + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 + aws-region: us-east-1 diff --git a/src/main/java/com/journaldev/spring/controller/FileUploadController.java b/src/main/java/com/journaldev/spring/controller/FileUploadController.java index ec71bf3..6a91123 100644 --- a/src/main/java/com/journaldev/spring/controller/FileUploadController.java +++ b/src/main/java/com/journaldev/spring/controller/FileUploadController.java @@ -99,8 +99,11 @@ String uploadMultipleFileHandler(@RequestParam("name") String[] names, // Creating the directory to store file String rootPath = System.getProperty("catalina.home"); File dir = new File(rootPath + File.separator + "tmpFiles"); - if (!dir.exists()) - dir.mkdirs(); + if (!dir.exists()) { + if (!dir.mkdirs()) { + throw new RuntimeException("Failed to create tmpFiles dir."); + } + } // Create the file on server File serverFile = new File(dir.getAbsolutePath() diff --git a/src/main/java/com/journaldev/spring/controller/PDFhighlightDemo.java b/src/main/java/com/journaldev/spring/controller/PDFhighlightDemo.java index 1d1bf16..28c4e24 100644 --- a/src/main/java/com/journaldev/spring/controller/PDFhighlightDemo.java +++ b/src/main/java/com/journaldev/spring/controller/PDFhighlightDemo.java @@ -23,10 +23,11 @@ public PDFhighlightDemo() throws IOException { public static void main(String[] args) throws IOException { - String rootPath = System.getProperty("catalina.home"); - File dir = new File(rootPath + File.separator + "tmpFiles"); - if (!dir.exists()) - dir.mkdirs(); +// String rootPath = System.getProperty("catalina.home"); +// File dir = new File(rootPath + File.separator + "tmpFiles"); +// if (!dir.exists()) +// dir.mkdirs(); +// PDDocument document = null; String fileName = "/Users/mqzhu/apache-tomcat-9.0.69/tmpFiles/saturdayprelimsdeepprogram_032348.pdf"; diff --git a/target/classes/com/journaldev/spring/controller/FileUploadController.class b/target/classes/com/journaldev/spring/controller/FileUploadController.class index a77e10e46eb60b6e6492bb1f1948eec25ac369a6..444b9aa61f33192ce006a2dbc2f41db774e4164c 100644 GIT binary patch delta 995 zcmYk4OKenS6vuzx%yjPb&K(%8qH{}y>jF}#W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7EF4!r@JaEcegFk%F*W uK6Z~d&^YYE_~F__-iv62G5H{oB3yuv^x88rvok*l;}IWo1=EE40)GLkro_Vl diff --git a/target/classes/com/journaldev/spring/controller/PDFhighlightDemo.class b/target/classes/com/journaldev/spring/controller/PDFhighlightDemo.class index 6bf34c8ccd70e38ade3e855a749267071164a619..a9203e7e0e6b8dfec094789cc30b963e964be353 100644 GIT binary patch delta 2421 zcmZvd4Sdvf9mn6lyZ_z)cK6$D9E0s(z`;#IeaKs*tP1Cfa+9$Ny*a)uUY+WxZccS2yo{kt<05E99c4Z* z$F%{j?^p=KIktK2B_jHgl)p~{+VOc;BS zrkb$A+n-1;=Rr}eV@hES+RF@P**V{B9W_GkOEmQ~SkD`a)f}tZ zH9In%OEs6#s4)8D+Y*XV;g*p#H%wn+*EwI)WbJoVTF<)Xjt&f4bj7=q)vf8iRClt$ zn&@8N;D4*9qOdg`-?(LIymwW+y-R9qHd&=8&c`3&ZL-GNPg#qr#u}97w0Ss#{Y1X-$Go>jpDqY*JKMC;Sx|FG)6Qw$LSQNhZ>5 zO{u=dj?D^ZczUyscDgk^RN1#p?T~>a*{bQYtvzDBHr0{dWD6zqfGsQ(q21PniBxh^ z+SY8>y#IXg*l=)LyhHN=5ii1jKFpiC4{1JZyJ%4j2NGQYJK1G&&0E`Xb$>c>mF6Q{ zYhCA=IL+jviqijY*SvvLS4X1H?$O6JpWr&{w3=DIn=%i36a{V3Mct`%Ximt>ZuV+E z%?;KL$0c6-XxYclSPyz8U$I}|YY4^88+*7>I@S73FVUUv_Oc$Ea(8RK$+xV%1+@kD@NJWO6(M_1e9N2ck!bECYn>?w z8;2E_=NIT~VRW2_`=tj9Wn5juBg;`{@*O2BWAE6F-jd9ay%j?o(>%y`WyZ2SEj`;4 zeJzR3bek|E+-!4xi0^5>|26}m<`6&7{Lt3;#dURWZ=!FdovY1OJ*;`;?JDug@e|EY zIiakGuj#@ZKi53UFNV{v7>IW)?~zvZD_r6AlHcT)iWyS!jAEl<=gw;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y__U2s zS;)g81Kh?lAtm^1bA=L8gT2;ExpT5d#@jfmG}-u$jqgW&y*LpI{-g&dqyAo;Vj%xK znq%b1L@)A-BmSCSoZ_@xh1{!coHhJLj*avD5;p$Oi&tW9Tg80vA7cg|rs6(L5YSV5DpirTT7He(HK zMS`}YnRcTkOOKNK1Oy2ud&^2LWD5=|BDSkkVUt zn~QePW%QBctV*vDk%Nz=)2rlUNrjg#lERV;e!4&^OB!?A;FIRjS<-mZjS!tC zoh1)O(MfVM8@=3@5#%8+1lRun3G%VD87cB}VjrJn4dqaP18?V3=28$jTz)PMp*#dA zpQ|0p<@FazEDd;4hArI>>kjEgy1) From 751569e00894cef8c291aae2846ce56731426004 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 18:09:16 -0700 Subject: [PATCH 02/24] fix workflow file --- .DS_Store | Bin 6148 -> 8196 bytes .github/.DS_Store | Bin 0 -> 6148 bytes .github/workflows/aws-codeguru-reviewer.yml | 34 +------------------- .github/workflows/workflow.yml | 27 ---------------- 4 files changed, 1 insertion(+), 60 deletions(-) create mode 100644 .github/.DS_Store delete mode 100644 .github/workflows/workflow.yml diff --git a/.DS_Store b/.DS_Store index 95d9c98d05b0718c7f230edec5de2673599d843f..c1a6413a073f469e6f52130c03169dafd703f515 100644 GIT binary patch delta 658 zcmaKqJxjw-7==%ABTd_&MO3;dI=N`E;0NNME!N_ogZ=<%6KN~432oA~4&9tWRuRF` zK_ov;ob=ojHHlzCxHsJAydUSjldZ{78Gusvttue5IzPFVia~2BsH`o{%X9t%L%uFr z@X(C{G18(Zu_>N&x*oXNSYicKV8SMnKu>MQY}-y-#$=>>u9eUD;SSKK>7WNM!+m79 z+&70Ve6-WF+FAJ@58u=~eW$v+vAVri4fn<2I1_JlIq2I?zr!$W7BkG&gN19f(wR`> z>0_e)Jjq*f9=o<;bFzxpj6$cv9b*6oHx!zGT3^lxWQt*&!edc=+BHlU6`PtY%7_&% zb4>ZVY=p{R-NE!Wq{~U6M#$$4+UW$U^yP;O4fSL_j|(*D#xc&gN)N2GMmnX;Moslx jiA>`~6v{;gX~@aq^t_93ZlM-7jgn5k<w&zli|u~i}E08)>ZdW|4~5`?(8X*h7js2tiVjY$A2##`A*eTX9Y-2M<> z(%*qMyPK+2(qpT(nvrJTcz2$?erxS|h)DJ4<1SH)h&(uB%}2Arc$|IBYObdaROTK( zDJ4xM6<^Y|Z0UH23h>(bSTRjGP3hYD=^t^bV~p~ru?K(s&lsYOjJPaL9pi6&nkL1p z)45c&dgIyirq}egyyNJ%E~D9KHZS_4{E)A{X`RNacoZKblXBR4xv#U?D9I+dAtd7o zQjWeS*;to-J z3h@3Az!^h_l|{34pfM!?uz_x4i1~++If28_VPz2`FlDJgOI5DKP?nDVz~zMwD~py+ z$`v2VJz2R5MVY7L{((s+6 Date: Wed, 20 Sep 2023 18:11:32 -0700 Subject: [PATCH 03/24] fix workflow file --- .github/workflows/aws-codeguru-reviewer.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 3f09e43..c016783 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -1,5 +1,3 @@ -version: 1.0 - name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions on: [push] From af2d444bb95529dfbd4e6ec7727ab7a7127f8cba Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 18:16:48 -0700 Subject: [PATCH 04/24] fix workflow file --- .github/workflows/.DS_Store | Bin 0 -> 6148 bytes .github/workflows/aws-codeguru-reviewer.yml | 7 +++--- .github/workflows/workflowbackup.yml | 26 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/.DS_Store create mode 100644 .github/workflows/workflowbackup.yml diff --git a/.github/workflows/.DS_Store b/.github/workflows/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..63353ceda142d61da4de74c2832e6a72fc508303 GIT binary patch literal 6148 zcmeHK%Sr=55Uepd1ia*^7nvV0;2*3Z9z6R4nnXm{u(Dwdxy>K>iCQ&1iW~Q$2NCIp zp6co8?%65Wc>oCWZhZkv0ZgdEAY(w}9vnID$jR!yR_m z;`8@+XwlKray8F*WV@rbjNM~{nz*Is>AG%K%eq;zj!1l=&R(<70#3hQ`Jm$ELB(9w z8)v{7a0Z+KXW+*S@XVG>jt#wa2AlzB;DZ6}50NUY3MRw6b+FO(S>t1>o51!dS2> zm<%~W36@H<)KH!n!P4oEC9W!%3@sfY&&)by=J&@-$g|TQb2vg}=&dv04D=ZoS$C@Q z|BAoN;3L1E;yq`;8Te-mgz@5LG3TPn+4^O9I%^~KmMT$Pl0l)}y9BVKedHt$+IW=B YxT;_>R2BJiI?*oznGkQBfnQ+Y4a=!D^Z)<= literal 0 HcmV?d00001 diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index c016783..b81860a 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -9,10 +9,11 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 # This is a required field for CodeGuru - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 with: - role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 + aws-access-key-id: AKIA2CDJAS6ISQFJKJVH + aws-secret-access-key: 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 aws-region: us-east-1 - name: CodeGuru Reviewer uses: aws-actions/codeguru-reviewer@v1.1 diff --git a/.github/workflows/workflowbackup.yml b/.github/workflows/workflowbackup.yml new file mode 100644 index 0000000..c016783 --- /dev/null +++ b/.github/workflows/workflowbackup.yml @@ -0,0 +1,26 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # This is a required field for CodeGuru + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 + aws-region: us-east-1 + - name: CodeGuru Reviewer + uses: aws-actions/codeguru-reviewer@v1.1 + with: + s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix + - name: Upload review result + if: ${{ github.event_name != 'push' }} + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: codeguru-results.sarif.json + From 819b2ff5d164bfee9c6ce2b6b90acdf68d57e64b Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 18:21:22 -0700 Subject: [PATCH 05/24] test workflow push --- .github/workflows/aws-codeguru-reviewer.yml | 33 +++++++----------- .github/workflows/workflowbackup2.ym. | 27 ++++++++++++++ .../controller/FileUploadController.java | 2 +- .../controller/FileUploadController.class | Bin 4956 -> 4988 bytes 4 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/workflowbackup2.ym. diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index b81860a..15a61d6 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -1,27 +1,18 @@ name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 on: [push] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 # This is a required field for CodeGuru - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: AKIA2CDJAS6ISQFJKJVH - aws-secret-access-key: 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 - aws-region: us-east-1 - - name: CodeGuru Reviewer - uses: aws-actions/codeguru-reviewer@v1.1 - with: - s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - - name: Upload review result - if: ${{ github.event_name != 'push' }} - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: codeguru-results.sarif.json - + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/.github/workflows/workflowbackup2.ym. b/.github/workflows/workflowbackup2.ym. new file mode 100644 index 0000000..b81860a --- /dev/null +++ b/.github/workflows/workflowbackup2.ym. @@ -0,0 +1,27 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 # This is a required field for CodeGuru + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: AKIA2CDJAS6ISQFJKJVH + aws-secret-access-key: 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 + aws-region: us-east-1 + - name: CodeGuru Reviewer + uses: aws-actions/codeguru-reviewer@v1.1 + with: + s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix + - name: Upload review result + if: ${{ github.event_name != 'push' }} + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: codeguru-results.sarif.json + diff --git a/src/main/java/com/journaldev/spring/controller/FileUploadController.java b/src/main/java/com/journaldev/spring/controller/FileUploadController.java index 6a91123..06976d1 100644 --- a/src/main/java/com/journaldev/spring/controller/FileUploadController.java +++ b/src/main/java/com/journaldev/spring/controller/FileUploadController.java @@ -101,7 +101,7 @@ String uploadMultipleFileHandler(@RequestParam("name") String[] names, File dir = new File(rootPath + File.separator + "tmpFiles"); if (!dir.exists()) { if (!dir.mkdirs()) { - throw new RuntimeException("Failed to create tmpFiles dir."); + throw new RuntimeException("Failed to create " +rootPath + File.separator + "tmpFiles dir."); } } diff --git a/target/classes/com/journaldev/spring/controller/FileUploadController.class b/target/classes/com/journaldev/spring/controller/FileUploadController.class index 444b9aa61f33192ce006a2dbc2f41db774e4164c..443f3d2375e170f3912be36e58a62a878636c9e5 100644 GIT binary patch delta 856 zcmZva%Wo4`6vlryaWeMIL^zWQGKo%r$L6>IxoB%LJ6-1>%XNA= zVbaH1#kh9Io%eYzliK1sOB3!!jgyLq*J(ydHBNhmF)?_GFHJt+tT)3LKf9j+KUt{L z&!EW#zEYHRWs|NWKK9xCsjGY>Z&DyACmT|koD*co+h)|nhWSS0vLc+xwm0NbZH=26 znltU~PS&Kz3Pm89Zp#F@;*A*hS6|b(q0uSTqR_v8*}sn|!yIfG=F=AIaDioZFwe?C_K3BPh{?0Az_F2GddF(~ zp5xxRaP6#q$xpS|dVwEU$SvB!2x`xvDLE}e_ z-4aa`r}5L6?S+5oL3>Y$-_-VwXo=9@_lj1e=I7@6@bo+n=SE5n6SR8z(CZ_C^?9Cp oZ>_os&qWjR)Hc6Kq+|gWFSzY}QdM2`yC5a9vRd)wg1v(O0L1s(S^xk5 delta 801 zcmZvZOKcNY6o$W>I2kjZ6ng^2S>ie`eC2|)bjF_{+n)o6;C8n_S$I1i8iL~M8=M~1^vs40|p0KshHSoXXdSGb5ff! z_M${)okp)au1{A-+)!X@$6<~cOyUnksJecAqCF8yIz&3#Ch4@+1?VTQF`x)K z>E>8lswrH%K34BEH`{503oKFilC4dSpMpCQxa}L#7DG_D8T>~`KC})*h{IoqtEPIP&~)itCYJi7>`c2CS>`w zhq63-8q9q;_7CRiYRL0rgQxuN-V9dEIVADn220OzG{^C816IJ&vYfO6ScHE-N4p}LL~Ep*T-zFXLh!_RDBuiybT za*Q;6WMl!GxGXrvW?r&|SAwtE$~fE97czdB?Uc*M@1)EdkST;E^4K6l@|wr~WSAn# zR2i2@QA|+z`HPYH_^^0OwLD)Uw#NBdne-(;Ws;b(Q7JwtFt_CCzV%Cc_N;WAGLTYOvwUFo-yJsE)SPK7o~`QsSqp` H?FD=S=djUr From 6ec952207c89548e97738b16e0f36060139e4110 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 18:29:27 -0700 Subject: [PATCH 06/24] test workflow --- .github/workflows/workflowbackup.yml | 26 -------------------------- .github/workflows/workflowbackup2.ym. | 27 --------------------------- 2 files changed, 53 deletions(-) delete mode 100644 .github/workflows/workflowbackup.yml delete mode 100644 .github/workflows/workflowbackup2.ym. diff --git a/.github/workflows/workflowbackup.yml b/.github/workflows/workflowbackup.yml deleted file mode 100644 index c016783..0000000 --- a/.github/workflows/workflowbackup.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 # This is a required field for CodeGuru - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 - aws-region: us-east-1 - - name: CodeGuru Reviewer - uses: aws-actions/codeguru-reviewer@v1.1 - with: - s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - - name: Upload review result - if: ${{ github.event_name != 'push' }} - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: codeguru-results.sarif.json - diff --git a/.github/workflows/workflowbackup2.ym. b/.github/workflows/workflowbackup2.ym. deleted file mode 100644 index b81860a..0000000 --- a/.github/workflows/workflowbackup2.ym. +++ /dev/null @@ -1,27 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 # This is a required field for CodeGuru - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: AKIA2CDJAS6ISQFJKJVH - aws-secret-access-key: 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 - aws-region: us-east-1 - - name: CodeGuru Reviewer - uses: aws-actions/codeguru-reviewer@v1.1 - with: - s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - - name: Upload review result - if: ${{ github.event_name != 'push' }} - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: codeguru-results.sarif.json - From 5be5f9400f23e2e74f58e62ab798c93407a6efcb Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 18:50:10 -0700 Subject: [PATCH 07/24] test workflow --- .github/.DS_Store | Bin 6148 -> 6148 bytes .github/workflows/aws-codeguru-reviewer.yml | 10 ++++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/.DS_Store b/.github/.DS_Store index 7a53642c13d118cb6e291757f5680cf88c37c9ca..6626a5e57109cdba7516af6aa7e99a6840cb05e6 100644 GIT binary patch delta 50 zcmZoMXffCj&&0TWaspE!mw0uxiKUK$v8l!6J517yos)ks$uo9Mwqp|8tjBzlWiuPc GKYjp|!Vk>= delta 51 zcmZoMXffCj&&0T6aspE!w?uWdsiB#Uf{D4| Date: Wed, 20 Sep 2023 22:29:21 -0700 Subject: [PATCH 08/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 63bf168..e7a8c2c 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -23,6 +23,10 @@ jobs: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: AKIA2CDJAS6ISQFJKJVH - aws-secret-access-key: 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 - aws-region: us-east-1 \ No newline at end of file + aws-access-key-id: AKIA2CDJAS6IWSKWTG7E + aws-secret-access-key: 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 + aws-region: us-east-1 + - name: CodeGuru Reviewer + uses: aws-actions/codeguru-reviewer@v1.1 + with: + s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix \ No newline at end of file From 862d308bc02892f325d127d1bb6e9218cea4c9df Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 23:30:38 -0700 Subject: [PATCH 09/24] test codeguru --- .DS_Store | Bin 8196 -> 8196 bytes .github/.DS_Store | Bin 6148 -> 6148 bytes .github/workflows/aws-codeguru-reviewer.yml | 7 ++++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index c1a6413a073f469e6f52130c03169dafd703f515..7fd27cb457b9065cb699a3a7adbab89c3a964ef7 100644 GIT binary patch delta 21 ccmZp1XmQw}A;@82WT~TIY-zFCK=2A507C8s;{X5v delta 21 ccmZp1XmQw}A;@8BXr`lJVs5zEK=2A5077a7)Bpeg diff --git a/.github/.DS_Store b/.github/.DS_Store index 6626a5e57109cdba7516af6aa7e99a6840cb05e6..7bf70da2ce313e1cd452c9613b236846cb26740e 100644 GIT binary patch delta 50 zcmZoMXffCj&&0T6aspE!mqc~7g^{I>g0bb~TTC*HU6a2v$uo9Owqp|8tjm0pWiva+ GUw#0US`W|w delta 49 zcmZoMXffCj&&0TWaspE!r+9U>iKUK$vFYU7Ofrm}lYcPDGj>h3V-nk}$9$7zGaJW0 FegKE$50n4^ diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index e7a8c2c..75bc5c6 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -29,4 +29,9 @@ jobs: - name: CodeGuru Reviewer uses: aws-actions/codeguru-reviewer@v1.1 with: - s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix \ No newline at end of file + s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix + - name: Upload review result + if: ${{ github.event_name != 'push' }} + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: codeguru-results.sarif.json \ No newline at end of file From 9a667de07934976f8a6cb6f36cc552ecef826c48 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Wed, 20 Sep 2023 23:38:10 -0700 Subject: [PATCH 10/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 75bc5c6..a893b2a 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -8,10 +8,6 @@ jobs: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - name: List files in the repository run: | ls ${{ github.workspace }} From 5ccc4962769e31dd3dd9929bed51e09898118c06 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 09:21:47 -0700 Subject: [PATCH 11/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index a893b2a..1691ca5 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -28,6 +28,10 @@ jobs: s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - name: Upload review result if: ${{ github.event_name != 'push' }} + run: | + echo "event is not push : ${{ github.event_name }}" uses: github/codeql-action/upload-sarif@v1 with: - sarif_file: codeguru-results.sarif.json \ No newline at end of file + sarif_file: codeguru-results.sarif.json + - run: | + ls \ No newline at end of file From de4e22a6d53a18516659f8c17a5dacb24c1b8671 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 09:23:30 -0700 Subject: [PATCH 12/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 1691ca5..b3b0468 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -29,7 +29,7 @@ jobs: - name: Upload review result if: ${{ github.event_name != 'push' }} run: | - echo "event is not push : ${{ github.event_name }}" + ls ${{ github.workspace }} uses: github/codeql-action/upload-sarif@v1 with: sarif_file: codeguru-results.sarif.json From 3b2d0a3aceca6ee52a4ebf747f7987d55311e6ce Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 09:25:59 -0700 Subject: [PATCH 13/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index b3b0468..435ed11 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -27,11 +27,10 @@ jobs: with: s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - name: Upload review result + - run: echo "event name is ${{ github.event_name }}" if: ${{ github.event_name != 'push' }} - run: | - ls ${{ github.workspace }} uses: github/codeql-action/upload-sarif@v1 with: sarif_file: codeguru-results.sarif.json - - run: | + - run: | ls \ No newline at end of file From 79c4b51351cd7a646cd1378a7d69d6e818c3dbfa Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 09:28:04 -0700 Subject: [PATCH 14/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 435ed11..88eccb4 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -27,7 +27,6 @@ jobs: with: s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - name: Upload review result - - run: echo "event name is ${{ github.event_name }}" if: ${{ github.event_name != 'push' }} uses: github/codeql-action/upload-sarif@v1 with: From fd8f1ee917419e657cf832995da3abed93b2ea6d Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 10:22:49 -0700 Subject: [PATCH 15/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 88eccb4..db1259c 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -27,7 +27,7 @@ jobs: with: s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - name: Upload review result - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name == 'push' }} uses: github/codeql-action/upload-sarif@v1 with: sarif_file: codeguru-results.sarif.json From a5cbc0e9dfb743f022eec25c5b82236c12436883 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 10:34:55 -0700 Subject: [PATCH 16/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index db1259c..cd72b50 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -28,7 +28,7 @@ jobs: s3_bucket: codeguru-reviewer-ming-bucket # S3 Bucket with "codeguru-reviewer-*" prefix - name: Upload review result if: ${{ github.event_name == 'push' }} - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v2 with: sarif_file: codeguru-results.sarif.json - run: | From 9d39c1c1fc2eb313d8bdb1cdaad90559b63fa888 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 11:10:55 -0700 Subject: [PATCH 17/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index cd72b50..b190940 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -1,6 +1,10 @@ name: GitHub Actions Demo run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] +on: + push: + branches: [main, mingTest] + pull_request: + branches: [main] jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest From 4c5a4f5527b0617fee4e1be63418dccea5a198f6 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 11:48:50 -0700 Subject: [PATCH 18/24] test codeguru --- .github/workflows/aws-codeguru-reviewer.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index b190940..45966f9 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -8,6 +8,10 @@ on: jobs: Explore-GitHub-Actions: runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write steps: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" From b1c2922024e7bf341f50d5b4e5f6508696743243 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 13:15:23 -0700 Subject: [PATCH 19/24] remove keys --- .github/workflows/aws-codeguru-reviewer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 45966f9..85a1a6b 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -27,8 +27,8 @@ jobs: - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: - aws-access-key-id: AKIA2CDJAS6IWSKWTG7E - aws-secret-access-key: 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 + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - name: CodeGuru Reviewer uses: aws-actions/codeguru-reviewer@v1.1 From 6f32e6fe9f1ccd62b3705164dfd7fcd45b4202e6 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 14:04:39 -0700 Subject: [PATCH 20/24] add workflow back --- .DS_Store | Bin 8196 -> 8196 bytes .github/workflows/aws-codeguru-reviewer.yml | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.DS_Store b/.DS_Store index 7fd27cb457b9065cb699a3a7adbab89c3a964ef7..a97af014ef8777448bfeb209151fcb8b7d9fde22 100644 GIT binary patch delta 16 XcmZp1XmQw}A;@fMX|!2e@FpJsE5-!t delta 16 XcmZp1XmQw}A;@fDWVu;e@FpJsE7t_> diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 85a1a6b..5e11db5 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -25,10 +25,9 @@ jobs: with: fetch-depth: 0 # This is a required field for CodeGuru - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v3 with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 aws-region: us-east-1 - name: CodeGuru Reviewer uses: aws-actions/codeguru-reviewer@v1.1 From 3cfc16e608c363a5552d007468b70db1849b6663 Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 14:08:17 -0700 Subject: [PATCH 21/24] add workflow back --- .github/workflows/aws-codeguru-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index 5e11db5..d931e91 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -25,7 +25,7 @@ jobs: with: fetch-depth: 0 # This is a required field for CodeGuru - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v3 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 aws-region: us-east-1 From dcd441ea499cb588abd61bff792ae2561769821d Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 14:25:54 -0700 Subject: [PATCH 22/24] add workflow back --- .github/.DS_Store | Bin 6148 -> 6148 bytes .github/workflows/aws-codeguru-reviewer.yml | 13 ++++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/.DS_Store b/.github/.DS_Store index 7bf70da2ce313e1cd452c9613b236846cb26740e..a42de408941cecb4e937ca8de2a4c715ce112e65 100644 GIT binary patch delta 21 ccmZoMXffDug^9!5#6U;E$lPG_9VQJ?080S|MF0Q* delta 21 ccmZoMXffDug^9z$$Wlka*wSM29VQJ?085_+SO5S3 diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index d931e91..e88189e 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -16,6 +16,12 @@ jobs: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Hello world action + with: # Set the secret as an input + super_secret: ${{ secrets.TEST_SECRET_1 }} + env: # Or as an environment variable + super_secret: ${{ secrets.TEST_SECRET_1 }} + - run: echo "TEST secret ${{ secrets.TEST_SECRET_1 }}" - name: List files in the repository run: | ls ${{ github.workspace }} @@ -25,9 +31,10 @@ jobs: with: fetch-depth: 0 # This is a required field for CodeGuru - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::691709974417:role/codeguru-reviewer-role1 + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - name: CodeGuru Reviewer uses: aws-actions/codeguru-reviewer@v1.1 From f0d5ecd3ec68e40f05fc0a63c6752ebb02fcd76f Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 14:27:43 -0700 Subject: [PATCH 23/24] fix workflow --- .github/workflows/aws-codeguru-reviewer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index e88189e..de5135d 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -31,8 +31,8 @@ jobs: with: fetch-depth: 0 # This is a required field for CodeGuru - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: + uses: aws-actions/configure-aws-credentials@v1 + with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 From deef3bf4e937ff712b7c7d50c67662e459bf985b Mon Sep 17 00:00:00 2001 From: Ming Zhu Date: Thu, 21 Sep 2023 14:31:13 -0700 Subject: [PATCH 24/24] fix workflow --- .github/workflows/aws-codeguru-reviewer.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/aws-codeguru-reviewer.yml b/.github/workflows/aws-codeguru-reviewer.yml index de5135d..37bac9d 100644 --- a/.github/workflows/aws-codeguru-reviewer.yml +++ b/.github/workflows/aws-codeguru-reviewer.yml @@ -16,11 +16,6 @@ jobs: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Hello world action - with: # Set the secret as an input - super_secret: ${{ secrets.TEST_SECRET_1 }} - env: # Or as an environment variable - super_secret: ${{ secrets.TEST_SECRET_1 }} - run: echo "TEST secret ${{ secrets.TEST_SECRET_1 }}" - name: List files in the repository run: |