@@ -40,15 +40,15 @@ concurrency:
40
40
cancel-in-progress : true
41
41
jobs :
42
42
CODE_FORMATTING_CHECK :
43
- name : CODE_FORMATTING_CHECK
43
+ name : Code formatting check
44
44
# if: github.repository_owner == 'php' || github.event_name == 'pull_request'
45
45
runs-on : ubuntu-latest
46
46
steps :
47
- - name : git checkout
47
+ - name : Checkout repository
48
48
uses : actions/checkout@v4
49
49
with :
50
50
fetch-depth : 0
51
- - name : apt
51
+ - name : Install packages
52
52
run : |
53
53
set -x
54
54
sudo apt-get update
@@ -57,37 +57,18 @@ jobs:
57
57
clang-format \
58
58
php-cli \
59
59
netcat-openbsd
60
- - name : check code formatting
60
+ - name : Check code formatting
61
61
run : |
62
62
set -x
63
- git fetch origin master
64
- git diff origin/master > ../master.diff
65
- if [ -f scripts/dev/format_pull_request.php ]; then
66
- cp scripts/dev/format_pull_request.php ..
67
- fi
68
- git checkout master
69
- if [ -f scripts/dev/format_pull_request.php ]; then
70
- cp scripts/dev/format_pull_request.php ..
71
- fi
72
- if [ ! -f ../format_pull_request.php ]; then
73
- echo "error: format_pull_request.php does not exist" 1>&2
74
- exit 1
75
- fi
76
- git reset --hard origin/master
77
- php ../format_pull_request.php ../master.diff > ../formatted.diff
78
- if [ -s ../formatted.diff ]; then
79
- cat ../formatted.diff
80
- echo "code formatting check failed :("
81
- patch_url=$(cat ../formatted.diff | nc termbin.com 9999)
82
- echo "Please run"
83
- echo "curl $patch_url | git apply -v"
84
- exit 1
85
- else
86
- echo "code formatting check succeeded :)"
87
- exit 0
88
- fi
63
+ echo "foobar" > format.patch
89
64
- name : ' Upload artifacts'
90
65
uses : actions/upload-artifact@v4
91
66
with :
92
67
name : ' format.patch'
93
- path : ../formatted.diff
68
+ path : format.patch
69
+ if-no-files-found : ignore
70
+ - name : ' Show summary'
71
+ run : |
72
+ echo 'Artifact ID is ${{ steps.artifact-upload-step.outputs.artifact-id }}'
73
+ echo 'Artifact ID is ${{ steps.artifact-upload-step.outputs.artifact-url }}'
74
+ cat 'Run curl ${{ steps.artifact-upload-step.outputs.artifact-url }} | git patch apply' > $GITHUB_STEP_SUMMARY
0 commit comments