Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz committed Oct 23, 2023
1 parent 361bfdc commit 82acdbd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:

jobs:
check-links:
if: github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -14,12 +13,12 @@ jobs:
install: false
# RUN SCRIPT TO USE VERCEL PREVIEW LINK FROM PR
- name: Update preview link
run: node scripts/generate-mlc-config.mjs ${{ github.event.deployment_status.environment_url }}
# RUN SCRIPT TO GENERATE NEW CONFIG WITH VERCEL PREVIEW URL
# RUN LINK CHECK
- uses: gaurav-nelson/github-action-markdown-link-check
with:
config-file: 'mlc-config.json'
file-extension: 'mdx'
# use-verbose-mode: 'yes'
folder-path: docs/guides/docs
run: node scripts/generate-mlc-config.mjs ${{ github.event.deployment_status.state }} ${{ github.event.deployment_status.environment_url }}
# # RUN SCRIPT TO GENERATE NEW CONFIG WITH VERCEL PREVIEW URL
# # RUN LINK CHECK
# - uses: gaurav-nelson/github-action-markdown-link-check
# with:
# config-file: 'mlc-config.json'
# file-extension: 'mdx'
# # use-verbose-mode: 'yes'
# folder-path: docs/guides/docs
16 changes: 9 additions & 7 deletions scripts/generate-mlc-config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import fs from 'fs';
// import fs from 'fs';

main();

function main() {
const previewURL = process.argv[2];
console.log('PREVIEW URL:', previewURL);
const configPath = './mlc-config-test.json';
const configFile = fs.readFileSync(configPath, 'utf-8');
const newContent = configFile.replace('{{VERCEL_PREVIEW}}', previewURL);
fs.writeFileSync(configPath, newContent);
console.log('DEPLOYMENT STATE:', process.argv[2]);
console.log('DEPLOYMENT URL:', process.argv[3]);
// const previewURL = process.argv[2];
// console.log('PREVIEW URL:', previewURL);
// const configPath = './mlc-config-test.json';
// const configFile = fs.readFileSync(configPath, 'utf-8');
// const newContent = configFile.replace('{{VERCEL_PREVIEW}}', previewURL);
// fs.writeFileSync(configPath, newContent);
}

0 comments on commit 82acdbd

Please sign in to comment.