Skip to content

Commit 9b5eb82

Browse files
committed
Resurrect support of auto-style on master
which was broken by 9255db4
1 parent cd42001 commit 9b5eb82

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/check_misc.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,25 @@ jobs:
2929
checkout: '' # false (ref: https://github.com/actions/runner/issues/2238)
3030

3131
# Run this step first to make sure auto-style commits are pushed
32-
- name: ${{ github.ref == 'refs/heads/master' && 'Auto-correct' || 'Check for' }} code styles
32+
- name: Auto-correct code styles
3333
run: |
3434
set -x
3535
ruby tool/auto-style.rb "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA" "$PUSH_REF"
3636
env:
37-
37+
GITHUB_OLD_SHA: ${{ github.event.before }}
38+
GITHUB_NEW_SHA: ${{ github.event.after }}
3839
GIT_AUTHOR_NAME: git
3940
GIT_COMMITTER_NAME: git
41+
42+
PUSH_REF: ${{ github.ref }}
43+
if: ${{ github.repository == 'ruby/ruby' && github.event_name == 'push' }}
44+
- name: Check for code styles
45+
run: |
46+
set -x
47+
ruby tool/auto-style.rb "$GITHUB_OLD_SHA" "$GITHUB_NEW_SHA"
48+
env:
4049
GITHUB_OLD_SHA: ${{ github.event.pull_request.base.sha }}
4150
GITHUB_NEW_SHA: ${{ github.event.pull_request.merge_commit_sha }}
42-
PUSH_REF: ${{ github.ref == 'refs/heads/master' && github.ref || '' }}
4351
if: ${{ github.repository == 'ruby/ruby' && startsWith(github.event_name, 'pull') }}
4452

4553
- name: Check if C-sources are US-ASCII

0 commit comments

Comments
 (0)