diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index a1a6e157c..c5764e5cd 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -5,7 +5,6 @@ on: jobs: check-links: - if: github.event.deployment_status.state == 'success' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -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 diff --git a/scripts/generate-mlc-config.mjs b/scripts/generate-mlc-config.mjs index e40e2e688..7429dd5e4 100644 --- a/scripts/generate-mlc-config.mjs +++ b/scripts/generate-mlc-config.mjs @@ -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); }