-
Notifications
You must be signed in to change notification settings - Fork 2.4k
45 lines (37 loc) · 1.48 KB
/
pr-assign-command.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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 }}