Skip to content

Commit

Permalink
move scripts to .github folder (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjohansebas authored Oct 26, 2024
1 parent 477d6ae commit fac7900
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

DEST="en/resources/contributing.md"
DEST="../../en/resources/contributing.md"

# This script replaces the contents of a section with the contents from
# the annotated source address.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const response = await (await fetch(NPMURL)).json()
const { next, latest } = response['dist-tags']

try {
const filePath = path.resolve(path.join('_data', 'express.yml'))
const filePath = path.resolve(path.join('..', '..', '_data', 'express.yml'))
let content = await readFile(filePath, 'utf8')

content = content.replace(/current_version: ".*"/, `current_version: "${latest}"`)
Expand Down
4 changes: 2 additions & 2 deletions get-readmes.sh → .github/scripts/get-readmes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ expressjs express master/examples
LIST_END
) | while read org repo branch; do
# Write the README.md to a file named after the repo
DEST="_includes/readmes/$repo.md"
DEST="../../_includes/readmes/$repo.md"
# When fetching from a branch of a gh repo
GHURL="https://raw.githubusercontent.com/$org/$repo/$branch/README.md"
# When fetching from the latest release of a node module
Expand All @@ -42,7 +42,7 @@ LIST_END
# This allows us to specify a branch other than master if we want to.
# In this case, the branch name is added to the readme name in the filename.
if [ "$branch" != "master" ]; then
DEST="_includes/readmes/$repo-$branch.md"
DEST="../../_includes/readmes/$repo-$branch.md"
fi
echo "fetching $org/$repo/$branch from GitHub's raw content domain..."
curl -s $GHURL > $DEST
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-external-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
node-version: 20
- name: Run scripts
working-directory: .github/scripts
run: |
bash ./get-contributing.sh
bash ./get-readmes.sh
Expand Down

0 comments on commit fac7900

Please sign in to comment.