Skip to content

International Mathematical Olympiad (IMO) Data #87

International Mathematical Olympiad (IMO) Data

International Mathematical Olympiad (IMO) Data #87

# Workflow based on from https://github.com/r-lib/actions/tree/v2/examples
on:
issue_comment:
types: [created]
name: Commands
jobs:
assign:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/assign') }}
name: assign
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
GITHUB_COMMENT_BODY: ${{ github.event.comment.body }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Assign
shell: Rscript {0}
run: |
src_folder_name <- strsplit(Sys.getenv("GITHUB_COMMENT_BODY"), " ")[[1]][[2]]
target_date <- strsplit(Sys.getenv("GITHUB_COMMENT_BODY"), " ")[[1]][[3]]
source("static/templates/assign_week.R", local = TRUE)
- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add --all
git commit -m 'Accept submission'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}