-
Notifications
You must be signed in to change notification settings - Fork 103
Comment specific preview links for changed files #1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
"", | ||
...links, | ||
"", | ||
"🔔 *The preview site may take up to **5 minutes** to finish building. These links will become live once it completes.*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 minutes? 😢 https://github.com/elastic/docs-content/actions/workflows/docs-build.yml begs to differ!
Its a safe margin I get it 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just spotted the attempts to update on deployment created ❤️ that!
I think adding these permissions to the workflow would be sufficient.
permissions:
deployments: read
https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#permissions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh snap! Thanks, I'll give this a try
@Mpdreamz can we merge this? I was about to open an issue asking for this functionality 🚀 |
Copies workflow added to `docs-content` repo in elastic/docs-content#1341 • triggers on pull request events (open, reopen, sync) • comments with URL preview links for changed docs • fetches all files in the pr using github api • filters for added/modified .md files, excluding removed files and _snippets/ directory • transforms file paths into preview urls on docs-v3-preview.elastic.dev • checks for existing bot comment • updates existing comment or creates new one if none exists
* [DOCS] Add docs-preview-comment.yml Copies workflow added to `docs-content` repo in elastic/docs-content#1341 • triggers on pull request events (open, reopen, sync) • comments with URL preview links for changed docs • fetches all files in the pr using github api • filters for added/modified .md files, excluding removed files and _snippets/ directory • transforms file paths into preview urls on docs-v3-preview.elastic.dev • checks for existing bot comment • updates existing comment or creates new one if none exists * use pull_request_target, add perms - changed event trigger from pull_request to pull_request_target - added permissions for contents: read, issues: write, pull-requests: write
Summary
This PR adds a comment with links from each changed file to the built location in the deployment preview. This comment will be updated every time a new commit is pushed.