Skip to content

Commit

Permalink
Add commenting from github-actions bot (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannysheridan authored Nov 8, 2023
1 parent 3559b6b commit 3498e57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ jobs:
run: |
output=$(fern generate --docs --preview)
echo "$output"
# Extract the URL and append it to GITHUB_ENV
echo "preview_url=$(echo "$output" | grep -oP '(?<=Published docs to )https://[^\s]*')" >> $GITHUB_ENV
# Extract the URL
preview_url=$(echo "$output" | grep -oP '(?<=Published docs to )https://[^\s]*')
# Set the output for the step
echo "::set-output name=preview_url::$preview_url"
- name: Comment PR with URL using github-actions bot
uses: actions/github-script@v4
if: ${{ steps.generate_docs.outputs.preview_url }}
with:
script: |
const preview_url = '${{ env.preview_url }}';
const preview_url = '${{ steps.generate_docs.outputs.preview_url }}';
const issue_number = context.issue.number;
github.issues.createComment({
...context.repo,
Expand Down

0 comments on commit 3498e57

Please sign in to comment.