docs: work around bug causing version dropdown to fail #265
Workflow file for this run
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: "Link docsite preview" | |
on: # yamllint disable-line rule:truthy | |
pull_request_target: | |
paths: | |
- "docs/*" | |
types: | |
- opened | |
- edited | |
- synchronize | |
jobs: | |
link: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Get hash for branch | |
id: hash | |
env: | |
# not just pointless indirection; this mitigates script injections | |
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#good-practices-for-mitigating-script-injection-attacks | |
BRANCH: ${{ github.event.pull_request.head.ref }} | |
run: | | |
echo "branch: $BRANCH" | |
SUM="$(echo -n "$BRANCH" | md5sum | awk '{print $1}')" && echo $SUM | |
echo "SUM=${SUM}" >> $GITHUB_OUTPUT | |
- uses: peter-evans/create-or-update-comment@v3 | |
with: | |
token: ${{ secrets.DETERMINED_TOKEN }} | |
issue-number: ${{ github.event.number }} | |
body: | | |
Docsite preview being generated for this PR. | |
You can (eventually) find the generated docsite [here](https://determined-ai-docs.s3.us-west-2.amazonaws.com/previews/${{ steps.hash.outputs.SUM }}/index.html). |