Open piyokintv opened 1 year ago
phpcsの出力結果をジョブ間で共有はできるが、checkstyle_filter-git
でエラーになる
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 "="; 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 "="; 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 "="; 0 found" source="PSR12.Operators.OperatorSpacing.NoSpaceBefore"/>
<error line="21" column="15" severity="error" message="Expected at least 1 space after "="; 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.
差分のある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(上記ログと同じ)」のせい
現状、phpcs
やcheckstyle_filter-git
の出力結果を|
やxargs
で渡すことで対処
https://github.com/piyokintv/hayasaka/actions/runs/3571492104
https://github.com/piyokintv/hayasaka/actions/runs/3571427085
https://github.com/piyokintv/hayasaka/actions/runs/3571389199
https://github.com/piyokintv/hayasaka/actions/runs/3571356663