piyokintv / hayasaka

0 stars 0 forks source link

phpcsのcheckstyle出力結果をジョブ間で共有したい #5

Open piyokintv opened 1 year ago

piyokintv commented 1 year ago

https://github.com/piyokintv/hayasaka/actions/runs/3571492104

Run echo 'reported-checkstyle<<</file></checkstyle>' >> $GITHUB_OUTPUT
  echo 'reported-checkstyle<<</file></checkstyle>' >> $GITHUB_OUTPUT
  echo "$(phpcs -q --report=checkstyle --standard=PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003417276#step:7:2) Controllers/UserControllers.php)" >> $GITHUB_OUTPUT
  echo '</file></checkstyle>' >> $GITHUB_OUTPUT
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
Run checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?>
  checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?>
  <checkstyle version="3.7.1">
  <file name="/home/runner/work/hayasaka/hayasaka/Controllers/UserControllers.php">
   <error line="18" column="18" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:2).Operators.OperatorSpacing.NoSpaceBefore"/>
   <error line="18" column="18" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
   <error line="19" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
   <error line="19" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="19" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
   <error line="19" column="1[3](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:3)" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="19" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="19" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
   <error line="19" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="19" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="19" column="[4](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:4)3" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
   <error line="19" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="21" column="1[5](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:5)" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
   <error line="21" column="15" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
   <error line="22" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
   <error line="22" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="22" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
   <error line="22" column="13" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="22" column="2[6](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:6)" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="22" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
   <error line="22" column="2[7](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:7)" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="22" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="22" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
   <error line="22" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
  </file>
  </checkstyle>
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/1[8](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:8)ae2404-2b0a-4a5a-[9](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:9)c98-8[27](https://github.com/piyokintv/hayasaka/actions/runs/3571492104/jobs/6003419826#step:5:27)0f6508092.sh: line 1: syntax error near unexpected token `newline'
Error: Process completed with exit code 2.

https://github.com/piyokintv/hayasaka/actions/runs/3571427085

Run echo "reported-checkstyle=$(phpcs -q --report=checkstyle --standard=PSR12 Controllers/UserControllers.php)" >> $GITHUB_OUTPUT
  echo "reported-checkstyle=$(phpcs -q --report=checkstyle --standard=PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571427085/jobs/6003285326#step:7:2) Controllers/UserControllers.php)" >> $GITHUB_OUTPUT
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
Error: Unable to process file command 'output' successfully.
Error: Invalid format '</file>'

https://github.com/piyokintv/hayasaka/actions/runs/3571389199

Run echo 'reported-checkstyle<<EOF' >> $GITHUB_OUTPUT
  echo 'reported-checkstyle<<EOF' >> $GITHUB_OUTPUT
  echo "$(phpcs -q --report=checkstyle --standard=PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003214873#step:7:2) Controllers/UserControllers.php)" >> $GITHUB_OUTPUT
  echo 'EOF' >> $GITHUB_OUTPUT
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
Run checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?>
  checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?>
  <checkstyle version="3.7.1">
  <file name="/home/runner/work/hayasaka/hayasaka/Controllers/UserControllers.php">
   <error line="18" column="18" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:2).Operators.OperatorSpacing.NoSpaceBefore"/>
   <error line="18" column="18" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
   <error line="19" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
   <error line="19" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="19" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
   <error line="19" column="1[3](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:3)" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="19" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="19" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
   <error line="19" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="19" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="19" column="[4](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:4)3" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
   <error line="19" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="21" column="1[5](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:5)" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
   <error line="21" column="15" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
   <error line="22" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
   <error line="22" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="22" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
   <error line="22" column="13" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="22" column="2[6](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:6)" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="22" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
   <error line="22" column="2[7](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:7)" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="22" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="22" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
   <error line="22" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
  </file>
  </checkstyle>
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/7[8](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:8)e624f6-a705-4754-af[9](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:9)8-5b7[10](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:10)[13](https://github.com/piyokintv/hayasaka/actions/runs/3571389199/jobs/6003217620#step:5:13)0b5e3.sh: line 1: syntax error near unexpected token `newline'
Error: Process completed with exit code 2.

https://github.com/piyokintv/hayasaka/actions/runs/3571356663

Run echo 'reported-checkstyle<<EOF' >> $GITHUB_OUTPUT
  echo 'reported-checkstyle<<EOF' >> $GITHUB_OUTPUT
  echo $(phpcs -q --report=checkstyle --standard=PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571356663/jobs/6003153156#step:7:2) Controllers/UserControllers.php) >> $GITHUB_OUTPUT
  echo 'EOF' >> $GITHUB_OUTPUT
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
Run checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?> <checkstyle version="3.7.1"> <file name="/home/runner/work/hayasaka/hayasaka/Controllers/UserControllers.php"> <error line="18" column="18" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/> <error line="18" column="18" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/> <error line="19" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/> <error line="19" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="19" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/> <error line="19" column="13" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="19" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> <error line="19" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/> <error line="19" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="19" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="19" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/> <error line="19" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> <error line="21" column="15" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/> <error line="21" column="15" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/> <error line="22" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/> <error line="22" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="22" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/> <error line="22" column="13" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="22" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> <error line="22" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/> <error line="22" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="22" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="22" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/> <error line="22" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> </file> </checkstyle>
  checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?> <checkstyle version="3.7.1"> <file name="/home/runner/work/hayasaka/hayasaka/Controllers/UserControllers.php"> <error line="18" column="18" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3571356663/jobs/6003156061#step:5:2).Operators.OperatorSpacing.NoSpaceBefore"/> <error line="18" column="18" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/> <error line="19" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/> <error line="19" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="19" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/> <error line="19" column="1[3](https://github.com/piyokintv/hayasaka/actions/runs/3571356663/jobs/6003156061#step:5:3)" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="19" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> <error line="19" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/> <error line="19" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="19" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="19" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/> <error line="19" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> <error line="21" column="15" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/> <error line="21" column="15" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/> <error line="22" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/> <error line="22" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="22" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/> <error line="22" column="13" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="22" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> <error line="22" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/> <error line="22" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/> <error line="22" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/> <error line="22" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/> <error line="22" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/> </file> </checkstyle>
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/862a5c21-1e79-[4](https://github.com/piyokintv/hayasaka/actions/runs/3571356663/jobs/6003156061#step:5:5)c[5](https://github.com/piyokintv/hayasaka/actions/runs/3571356663/jobs/6003156061#step:5:6)3-9b30-29ff61a387a9.sh: line 1: syntax error near unexpected token `<'
Error: Process completed with exit code 2.

piyokintv commented 1 year ago

調査

https://stackoverflow.com/questions/74137120/how-to-fix-or-avoid-error-unable-to-process-file-command-output-successfully https://docs.github.com/ja/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings

piyokintv commented 1 year ago

phpcsの出力結果をジョブ間で共有はできるが、checkstyle_filter-gitでエラーになる

piyokintv commented 1 year ago

https://github.com/piyokintv/hayasaka/actions/runs/3580050285

Run echo 'reported-checkstyle<<EOF' >> $GITHUB_OUTPUT
  echo 'reported-checkstyle<<EOF' >> $GITHUB_OUTPUT
  echo "$(phpcs -q --report=checkstyle --standard=PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021830962#step:7:2) Controllers/UserControllers.php)" >> $GITHUB_OUTPUT
  echo 'EOF' >> $GITHUB_OUTPUT
  shell: /usr/bin/bash -e {0}
  env:
    COMPOSER_PROCESS_TIMEOUT: 0
    COMPOSER_NO_INTERACTION: 1
    COMPOSER_NO_AUDIT: 1
Run checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?>
  checkstyle_filter-git diff origin/main <?xml version="1.0" encoding="UTF-8"?>
  <checkstyle version="3.7.1">
  <file name="/home/runner/work/hayasaka/hayasaka/Controllers/UserControllers.php">
   <error line="18" column="18" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR1[2](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:2).Operators.OperatorSpacing.NoSpaceBefore"/>
   <error line="18" column="18" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
   <error line="19" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
   <error line="19" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="19" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
   <error line="19" column="1[3](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:3)" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="19" column="26" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="19" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
   <error line="19" column="27" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="19" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="19" column="[4](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:4)3" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
   <error line="19" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="21" column="1[5](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:5)" severity="error" message="Expected at least 1 space before &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
   <error line="21" column="15" severity="error" message="Expected at least 1 space after &quot;=&quot;; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceAfter"/>
   <error line="22" column="5" severity="error" message="Line indented incorrectly; expected 8 spaces, found 4" source="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
   <error line="22" column="5" severity="error" message="Expected 1 space(s) after IF keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="22" column="12" severity="error" message="Expected 1 space(s) after closing parenthesis; found 0" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis"/>
   <error line="22" column="13" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="22" column="2[6](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:6)" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
   <error line="22" column="26" severity="error" message="Expected 1 space after closing brace; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
   <error line="22" column="2[7](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:7)" severity="error" message="Expected 1 space(s) after ELSE keyword; 0 found" source="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword"/>
   <error line="22" column="31" severity="error" message="Newline required after opening brace" source="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"/>
   <error line="22" column="43" severity="error" message="Each PHP statement must be on a line by itself" source="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
   <error line="22" column="44" severity="error" message="Closing brace must be on a line by itself" source="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
  </file>
  </checkstyle>
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/232[8](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:8)2b30-c54c-45dd-ba47-4b[9](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:9)fef[19](https://github.com/piyokintv/hayasaka/actions/runs/3580050285/jobs/6021833659#step:5:19)afc4.sh: line 1: syntax error near unexpected token `newline'
Error: Process completed with exit code 2.
piyokintv commented 1 year ago

差分のあるphpファイルが2つ以上ある場合、下記エラー

Run echo "changed_files=$(git diff --name-only origin/main HEAD -- '*.php')" >> $GITHUB_OUTPUT
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'index.php'

おそらく「複数行output(上記ログと同じ)」のせい

piyokintv commented 1 year ago

現状、phpcscheckstyle_filter-gitの出力結果を|xargsで渡すことで対処