1
0
mirror of synced 2025-12-30 03:01:36 -05:00

move-content to update featuredLinks too (#46213)

This commit is contained in:
Peter Bengtsson
2023-11-27 11:10:38 -05:00
committed by GitHub
parent b868ab3b96
commit 06bc354c4c
5 changed files with 188 additions and 19 deletions

63
.github/workflows/move-content.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: Move content script test
# **What it does**: Tests the `npm run move-content` script
# **Why we have it**: To be sure it continues to work as expected
# **Who does it impact**: Docs team.
on:
pull_request:
paths:
- src/content-render/scripts/move-content.js
- 'src/frame/lib/**/*.js'
- .github/workflows/move-content.yml
permissions:
contents: read
jobs:
move-content-test:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: ./.github/actions/node-npm-setup
- name: Set up a dummy git user
run: |
# These must be set to something before running the move-content
# script because it depends on executing `git mv ...`
# and `git commit ...`
git config --global user.name any-body
git config --global user.email "any-body@example.com"
- name: Move hello-world.md to hello-wurld.md
env:
ROOT: src/fixtures/fixtures
run: |
npm run move-content -- \
src/fixtures/fixtures/content/get-started/quickstart/hello-world.md \
src/fixtures/fixtures/content/get-started/quickstart/hello-wurld.md
node src/content-render/scripts/test-moved-content.js \
src/fixtures/fixtures/content/get-started/quickstart/hello-world.md \
src/fixtures/fixtures/content/get-started/quickstart/hello-wurld.md
# TODO: Add tests that inspects the git log
git log | head -n 100
- name: Move code-security/getting-started to code-security/got-started
env:
ROOT: src/fixtures/fixtures
run: |
npm run move-content -- \
src/fixtures/fixtures/content/code-security/getting-started \
src/fixtures/fixtures/content/code-security/got-started
node src/content-render/scripts/test-moved-content.js \
src/fixtures/fixtures/content/code-security/getting-started \
src/fixtures/fixtures/content/code-security/got-started
# TODO: Add tests that inspects the git log
git log | head -n 100