Download project proposals #26
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
on: workflow_dispatch | |
name: Download project proposals | |
jobs: | |
download-proposals: | |
name: download-proposals | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SURVEY_ID: ${{ secrets.SURVEY_ID }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: | | |
local::. | |
- name: Download proposal | |
run: ukbAid::admin_download_proposals(most_recent = TRUE) | |
shell: Rscript {0} | |
- name: Make a PR of proposal | |
run: | | |
# Get name of new proposal file | |
PROPOSAL=$(git ls-files --others --exclude-standard | \ | |
grep "proposals/.*.yaml" | \ | |
xargs basename --suffix=.yaml) | |
git checkout -b new-proposal-${PROPOSAL} | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "[email protected]" | |
git add data-raw/projects/proposals/* | |
git commit -m "Project proposal: ${PROPOSAL}" | |
git push origin new-proposal-${PROPOSAL} | |
gh pr create \ | |
--head new-proposal-${PROPOSAL} \ | |
--label "proposal" \ | |
--title "Project proposal: ${PROPOSAL}" \ | |
--assignee AlisaDK,danielibsen,lwjohnst86 \ | |
--body "Provide feedback on the proposal here as comments below. You can also directly comment on the file itself in the 'Files changed' tab." |