Unverified Commit 487f5d6b authored by Delba de Oliveira's avatar Delba de Oliveira Committed by GitHub

[Docs] Fix validator action breaking when PRs originate from forks (#51668)

parent 554e58c3
...@@ -4,6 +4,8 @@ This action ensures that internal links in `.mdx` files in the `/docs/` director ...@@ -4,6 +4,8 @@ This action ensures that internal links in `.mdx` files in the `/docs/` director
The action is triggered by the workflow defined in `.github/workflows/validate-docs-links.yml`. The action is triggered by the workflow defined in `.github/workflows/validate-docs-links.yml`.
> **Note**: This action runs on `pull_request_target` and not `pull_request` because the latter does not have write access to create commit statuses for pull requests originating from forks.
## Usage ## Usage
This action is written in TypeScript and compiled locally before being pushed to GitHub. This action is written in TypeScript and compiled locally before being pushed to GitHub.
......
...@@ -137,7 +137,7 @@ function getHeadingsFromMarkdownTree(tree: Node<Data>): string[] { ...@@ -137,7 +137,7 @@ function getHeadingsFromMarkdownTree(tree: Node<Data>): string[] {
// Create a processor to parse MDX content // Create a processor to parse MDX content
const markdownProcessor = unified() const markdownProcessor = unified()
.use(markdown) .use(markdown)
.use(remarkToRehype, { allowDangerousHTML: true }) .use(remarkToRehype)
.use(raw) .use(raw)
.use(function compiler() { .use(function compiler() {
// A compiler is required, and we only need the AST, so we can // A compiler is required, and we only need the AST, so we can
......
name: 'validate-docs-links' name: 'validate-docs-links'
on: on:
pull_request: pull_request_target:
paths: paths:
- 'docs/**.mdx' - 'docs/**.mdx'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment