Skip to content

Commit d75f3e9

Browse files
committed
fixup! tools: add GitHub Action linter for pr-url
1 parent 0f6847a commit d75f3e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/linters.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ jobs:
105105
- uses: actions/checkout@v2
106106
with:
107107
fetch-depth: 2
108-
# GH Actions squash all commits into one, HEAD^ refers to the base branch.
108+
# GH Actions squashes all PR commits, HEAD^ refers to the base branch.
109109
- run: git diff HEAD^ HEAD -G"pr-url:" -- "*.md" | ./tools/lint-pr-url.mjs ${{ github.event.pull_request.html_url }}

tools/lint-pr-url.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ const fileDelimiter = /^\+\+\+ b\/(.+\.md)$/;
1313
const changeDelimiter = /^@@ -\d+,\d+ \+(\d+),\d+ @@/;
1414
const prUrlDefinition = /^\+\s+pr-url: (.+)$/;
1515

16+
const validatePrUrl = (url) => url == null || url === expectedPrUrl;
17+
1618
let currentFile;
1719
let currentLine;
1820

19-
const validatePrUrl = (url) => url == null || url === expectedPrUrl;
20-
2121
const diff = readline.createInterface({ input: process.stdin });
2222
for await (const line of diff) {
2323
if (fileDelimiter.test(line)) {

0 commit comments

Comments
 (0)