Skip to content

Commit 1624e7f

Browse files
committed
tools: automate updates for test/fixtures/test426
1 parent 4f24aff commit 1624e7f

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: test426 fixtures update
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 * * 0
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
update-test426-fixtures:
13+
if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
17+
with:
18+
persist-credentials: false
19+
20+
- name: Update test426 fixtures from tc39/source-map-tests
21+
run: bash tools/dep_updaters/update-test426-fixtures.sh
22+
23+
- name: Open or update PR for test426 fixtures
24+
uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5
25+
with:
26+
branch: actions/update-test426-fixtures
27+
author: Node.js GitHub Bot <[email protected]>
28+
title: 'test: update test426 fixtures from tc39/source-map-tests'
29+
commit-message: 'test: update test426 fixtures from tc39/source-map-tests'
30+
labels: test
31+
update-pull-request-title-and-body: true
32+
body: |
33+
This is an automated update of the test426 fixtures from https://github.com/tc39/source-map-tests.
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
TARGET_DIR="$(dirname "$0")/../../test/fixtures/test426"
6+
README="$(dirname "$0")/../../test/test426/README.md"
7+
TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz)
8+
SHA=$(basename "$TARBALL_URL")
9+
10+
TMP_DIR="$(mktemp -d)"
11+
curl -f "$TARBALL_URL" | tar -xzf - -C "$TMP_DIR"
12+
13+
rsync -a --delete "$TMP_DIR"/source-map-tests-"$SHA"/ "$TARGET_DIR"/
14+
15+
rm -rf "$TMP_DIR"
16+
17+
sed -i.bak "s#https://github.com/tc39/source-map-tests/commit/[0-9a-f]*#https://github.com/tc39/source-map-tests/commit/$SHA#" "$README"
18+
rm "$README.bak"
19+
20+
echo "test426 fixtures updated to $SHA."

0 commit comments

Comments
 (0)