Skip to content

Commit 8a49dfa

Browse files
committed
Merge branch 'js/ci-check-whitespace-updates'
CI update. * js/ci-check-whitespace-updates: ci(check-whitespace): restrict to the intended commits ci(check-whitespace): stop requiring a read/write token
2 parents 5a9b455 + a066a90 commit 8a49dfa

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

.github/workflows/check-whitespace.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ jobs:
1212
check-whitespace:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Set commit count
16-
shell: bash
17-
run: echo "COMMIT_DEPTH=$((1+$COMMITS))" >>$GITHUB_ENV
18-
env:
19-
COMMITS: ${{ github.event.pull_request.commits }}
20-
2115
- uses: actions/checkout@v2
2216
with:
23-
fetch-depth: ${{ env.COMMIT_DEPTH }}
17+
fetch-depth: 0
2418

2519
- name: git log --check
2620
id: check_out
@@ -47,25 +41,9 @@ jobs:
4741
echo "${dash} ${etc}"
4842
;;
4943
esac
50-
done <<< $(git log --check --pretty=format:"---% h% s" -${{github.event.pull_request.commits}})
44+
done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..)
5145
5246
if test -n "${log}"
5347
then
54-
echo "::set-output name=checkout::"${log}""
5548
exit 2
5649
fi
57-
58-
- name: Add Check Output as Comment
59-
uses: actions/github-script@v3
60-
id: add-comment
61-
env:
62-
log: ${{ steps.check_out.outputs.checkout }}
63-
with:
64-
script: |
65-
await github.issues.createComment({
66-
issue_number: context.issue.number,
67-
owner: context.repo.owner,
68-
repo: context.repo.repo,
69-
body: `Whitespace errors found in workflow ${{ github.workflow }}:\n\n\`\`\`\n${process.env.log.replace(/\\n/g, "\n")}\n\`\`\``
70-
})
71-
if: ${{ failure() }}

0 commit comments

Comments
 (0)