Skip to content
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

Workflow renovation #26

Merged
merged 14 commits into from
Aug 28, 2024
Prev Previous commit
Next Next commit
Create AnVIL_Feedback_Script.sh
avahoffman committed Aug 28, 2024
commit 2727912f7fb9820b2679af833e078cffd7b0b0c1
19 changes: 19 additions & 0 deletions scripts/AnVIL_Feedback_Script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Extract the title from the YAML front matter of index.Rmd
title=$(awk '/^title:/{gsub(/^title: /,""); print}' "index.Rmd" | grep -v '^$')

# Remove the outside quotation marks
title=$(sed -e 's/^"//' -e 's/"$//' <<< "$title")

# Replace spaces with '+'
title=${title// /+}

# Base url for the AnVIL Google Form
url_base="https://docs.google.com/forms/d/e/1FAIpQLScrDVb_utm55pmb_SHx-RgELTEbCCWdLea0T3IzS0Oj00GE4w/viewform?usp=pp_url&entry.1565230805="

# Replace the url inside _output.yml
perl -i -pe 's|https://docs.google.com/forms/d/e/1FAIpQLScrDVb_utm55pmb_SHx-RgELTEbCCWdLea0T3IzS0Oj00GE4w/viewform\?usp=pp_url&entry\.1565230805=.*"> Click|'${url_base}${title}'"> Click|g' _output.yml

# Print for Github actions
echo "The feedback link is: ${url_base}${title}"