Skip to content

Commit f2d39e9

Browse files
jhnaldoljharb
authored andcommitted
Meta: Update yet phrase checking with ESMeta v0.7.2 (#3739)
1 parent 8febdac commit f2d39e9

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

.github/workflows/esmeta-installer/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ runs:
1313
- name: set esmeta version and path
1414
shell: bash
1515
run: |
16-
# v0.7.1
17-
echo "ESMETA_VERSION=bd58590ef6badabbe71afdefa02dc32274902621" >> $GITHUB_ENV
16+
# v0.7.3
17+
echo "ESMETA_VERSION=9066adf1edefd5d7e8dbc6eaa878242bb591cc2b" >> $GITHUB_ENV
1818
echo "ESMETA_HOME=vendor/esmeta" >> $GITHUB_ENV
1919
- name: clone esmeta
2020
shell: bash

.github/workflows/esmeta-yetcheck.yml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,13 @@ jobs:
1313
fetch-depth: 0
1414
- name: install esmeta
1515
uses: ./.github/workflows/esmeta-installer
16-
- name: list added line numbers
17-
id: collect
18-
shell: bash
16+
- name: check for newly-introduced phrases
1917
env:
2018
FILE_PATH: spec.html
2119
BASE_SHA: ${{ github.event.pull_request.base.sha }}
2220
HEAD_SHA: ${{ github.sha }}
2321
run: |
24-
# zero-context diff, limited to the file we care about
25-
added_lines=$(git diff -U0 --no-color "${BASE_SHA}" "${HEAD_SHA}" -- "${FILE_PATH}" |
26-
# keep only the hunk headers (the @@ lines)
27-
awk '
28-
# Example header: @@ -158,0 +159,2 @@
29-
/^@@/ {
30-
# Extract “+<start>[,<count>]” part
31-
match($0, /\+([0-9]+)(,([0-9]+))?/, a)
32-
start = a[1]
33-
count = (a[3] == "" ? 1 : a[3])
34-
# Print every line number in the added range
35-
for (i = 0; i < count; i++) print start + i
36-
}
37-
')
38-
39-
# Join line numbers with comma or space (whichever format you need)
40-
added_joined=$(echo "$added_lines" | paste -sd "," -)
41-
added_lines_json="[$added_joined]"
42-
43-
# Set it as an output value
44-
echo "added_lines=$added_lines_json" >> "$GITHUB_OUTPUT"
45-
- name: check for newly-introduced phrases
46-
run: |
47-
"${ESMETA_HOME}"/bin/esmeta extract \
48-
-status \
49-
-extract:warn-action <<< ${{ steps.collect.outputs.added_lines }}
22+
"${ESMETA_HOME}"/bin/esmeta yet-check \
23+
-status -yet-check:github-alert -yet-check:log \
24+
"${BASE_SHA}" "${HEAD_SHA}"
25+
cat "${ESMETA_HOME}"/logs/yet-check/summary.md >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)