[Cloud Security] PCSUP-22206 #2475
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Preview changed docs | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
preview: | |
runs-on: ubuntu-latest | |
name: Preview changed-files | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
- name: Get changed files in the docs folder | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v35 | |
with: | |
json: true | |
json_raw_format: true | |
files: docs | |
- name: Show preview if any file(s) in the docs folder change | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { default: previewChanges } = await import('${{ github.workspace }}/bin/preview-changes.js') | |
await previewChanges({ | |
github, | |
context, | |
glob, | |
changes: ${{ steps.changed-files-specific.outputs.all_modified_files }} | |
}); |