Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docs_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
working-directory: docs/v2
run: ./render.sh
- name: Run docs tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bundle config set --local without 'development'
bundle install
Expand Down
21 changes: 20 additions & 1 deletion docs/v3/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,25 @@ import gulp from 'gulp';
import express from 'express';
import { glob } from 'glob';
import { LinkChecker } from 'linkinator';

import * as cheerio from 'cheerio';
import { instance as gaxios } from 'gaxios';

const githubToken = process.env.GITHUB_TOKEN;
console.log('GITHUB_TOKEN is', githubToken ? 'SET' : 'NOT SET');

// Add an interceptor to gaxios to include the GitHub token in the headers for requests to GitHub
gaxios.interceptors.request.add({
resolved: (config) => {
if (githubToken && config.url?.includes('github.com')) {
config.headers = {
...(config.headers || {}),
authorization: `Bearer ${githubToken}`,
};
}
return config;
},
rejected: (error) => Promise.reject(error),
});

function displayErrors(err, stdout, stderr) {
if (err) {
Expand Down Expand Up @@ -91,6 +108,8 @@ async function checkPathAndExit(path, options, done) {
recurse: options.recurse,
silent: options.silent,
markdown: options.markdown,
concurrency: 1,
retry: true,
};

try {
Expand Down