-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
tools: automate updates for test/fixtures/test426 #60978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1624e7f
48e118e
cfa16b6
d61c39a
6650abb
db0ea9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: test426 fixtures update | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: 0 0 * * 0 | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| update-test426-fixtures: | ||
| if: github.repository == 'nodejs/node' || github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Update test426 fixtures from tc39/source-map-tests | ||
| run: bash tools/dep_updaters/update-test426-fixtures.sh | ||
|
|
||
| - name: Open or update PR for test426 fixtures | ||
| uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5 | ||
| with: | ||
| branch: actions/update-test426-fixtures | ||
| author: Node.js GitHub Bot <[email protected]> | ||
| title: 'test: update test426 fixtures from tc39/source-map-tests' | ||
| commit-message: 'test: update test426 fixtures from tc39/source-map-tests' | ||
| labels: test | ||
| update-pull-request-title-and-body: true | ||
| body: | | ||
| This is an automated update of the test426 fixtures from https://github.com/tc39/source-map-tests. | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||||||||||||
| #!/bin/sh | ||||||||||||||||
|
|
||||||||||||||||
| set -e | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We get a much more useful debug output with
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) | ||||||||||||||||
|
|
||||||||||||||||
| TARGET_DIR="$BASE_DIR/test/fixtures/test426" | ||||||||||||||||
| README="$BASE_DIR/test/test426/README.md" | ||||||||||||||||
| TARBALL_URL=$(curl -fsIo /dev/null -w '%header{Location}' https://github.com/tc39/source-map-tests/archive/HEAD.tar.gz) | ||||||||||||||||
| SHA=$(basename "$TARBALL_URL") | ||||||||||||||||
|
|
||||||||||||||||
| TMP_DIR="$(mktemp -d)" | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| rm -rf "$TARGET_DIR" | ||||||||||||||||
| mkdir "$TARGET_DIR" | ||||||||||||||||
| curl -f "$TARBALL_URL" | tar -xz --strip-components 1 -C "$TARGET_DIR" | ||||||||||||||||
|
|
||||||||||||||||
| rm -rf "$TMP_DIR" | ||||||||||||||||
|
|
||||||||||||||||
| TMP_FILE=$(mktemp) | ||||||||||||||||
| sed "s#https://github.com/tc39/source-map-tests/commit/[0-9a-f]*#https://github.com/tc39/source-map-tests/commit/$SHA#" "$README" > "$TMP_FILE" | ||||||||||||||||
|
Comment on lines
+18
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| mv "$TMP_FILE" "$README" | ||||||||||||||||
|
|
||||||||||||||||
| echo "test426 fixtures updated to $SHA." | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this to
.github/workflows/tools.yml?