Skip to content

Commit 7b6a61a

Browse files
authored
Merge pull request #223 from mxschmitt/verify-detached/action.yml-in-pr-builds
ci: verify that the `action.yml` files are in sync
2 parents 3f6efa8 + a4b0140 commit 7b6a61a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/checkin.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ jobs:
1313
uses: actions/setup-node@v3
1414
with:
1515
node-version: 20
16+
- name: Verify that action.yml files are in sync
17+
run: |
18+
npm run update-detached-action.yml &&
19+
if ! git diff --exit-code \*action.yml
20+
then
21+
echo '::error::action.yml files are not in sync, maybe run `npm run update-detached-action.yml`?'
22+
exit 1
23+
fi
1624
- name: Install dependencies
1725
run: npm ci
1826
- name: Run tests
@@ -24,7 +32,8 @@ jobs:
2432
- name: Verify that the project is built
2533
run: |
2634
if [[ -n $(git status -s) ]]; then
27-
echo "ERROR: generated dist/ differs from the current sources"
35+
echo "ERROR: generated lib/ differs from the current sources"
36+
git status -s
2837
git diff
2938
exit 1
3039
fi

detached/action.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,3 @@ outputs:
6464
description: 'The raw SSH address without the "ssh" prefix (only set when detached mode is enabled)'
6565
web-url:
6666
description: 'The web URL to connect to the tmate session (only set when detached mode is enabled and web URL is available)'
67-

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"start": "node src/index.js",
99
"build": "ncc build src/main.js -o lib",
10+
"update-detached-action.yml": "sed '/^runs:$/{N;N;N;s/lib\\//..\\/&/g;};/^ detached:/{N;N;N;s/\\(default: .\\)false/\\1true/g;}' action.yml >detached/action.yml",
1011
"test": "GITHUB_EVENT_PATH= jest"
1112
},
1213
"repository": {

0 commit comments

Comments
 (0)