-
Notifications
You must be signed in to change notification settings - Fork 59.9k
68 lines (56 loc) · 2.46 KB
/
move-content.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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/content-render/scripts/test-move-content.ts
- 'src/frame/lib/**/*.js'
- .github/workflows/move-content.yml
# In case any of the dependencies affect the script
- 'package*.json'
- src/fixtures/fixtures/content/get-started/
- src/fixtures/fixtures/content/code-security/
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- 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 "[email protected]"
- 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/start-your-journey/hello-world.md \
src/fixtures/fixtures/content/get-started/start-your-journey/hello-wurld.md
npm run test-moved-content -- \
src/fixtures/fixtures/content/get-started/start-your-journey/hello-world.md \
src/fixtures/fixtures/content/get-started/start-your-journey/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
npm run test-moved-content -- \
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