Skip to content

Commit

Permalink
Merge branch 'main' into MounaBelaid-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
drmowinckels authored Mar 30, 2024
2 parents caa53f5 + acd6adc commit 3ab4970
Show file tree
Hide file tree
Showing 8 changed files with 654 additions and 42 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Annual Release

on:
schedule:
# Schedule to run at midnight on the 1st of January, April, July, and October
- cron: '0 0 1 1,4,7,10 *'

jobs:
create-release:
runs-on: ubuntu-latest
steps:
# Checkout your repository
- name: Checkout repo
uses: actions/checkout@v4


# Set up Git user
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Create a tag for the release
- name: Create Tag
run: |
RELEASE="$(date +"%Y").$(date +"%m")"
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
git tag -a "$RELEASE" -m "Automatic release $RELEASE"
git push origin "$RELEASE"
# Create a GitHub Release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE }}
name: "Automatic Release ${{ env.RELEASE }}"
body: "Quarterly release of the R-Ladies guide."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

41 changes: 41 additions & 0 deletions .github/workflows/greet-remind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Greet New Contributor

on:
pull_request:
types: [opened]

jobs:
greet-and-remind:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Check if user is a new contributor
env:
GITHUB_EVENT_PATH: ${{ github.event_path }}
id: is-new-contributor
run: |
PR_AUTHOR=$(jq -r .pull_request.user.login "$GITHUB_EVENT_PATH")
CONTRIBUTOR_COUNT=$(git log --format='%aN' | grep -i -c "^${PR_AUTHOR}$" || true)
echo "Contributor count: $CONTRIBUTOR_COUNT"
if [ "$CONTRIBUTOR_COUNT" -eq "0" ]; then
echo "new_contributor=true" >> $GITHUB_ENV
fi
- uses: actions/github-script@v6
name: "Comment to greet and remind"
if: env.new_contributor == 'true'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const PR_AUTHOR = context.payload.pull_request.user.login
await github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number}},
owner: 'rladies',
repo: 'rladiesguide',
body: `Welcome ${PR_AUTHOR}! It looks like this is your first contribution to this repository. 🎉\n\nPlease remember to add yourself to the '.zenodo.json'.`
})
56 changes: 56 additions & 0 deletions .github/workflows/validate-zenodo-json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Validate Zenodo Metadata

on:
push:
paths:
- '.zenodo.json'
pull_request:
paths:
- '.zenodo.json'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: install curl headers
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Install Dependencies
run: install.packages("jsonvalidate")
shell: Rscript {0}

- name: Get JSON schema
run: |
curl -s -o schema.json \
https://raw.githubusercontent.com/zenodo/zenodo/master/zenodo/modules/deposit/jsonschemas/deposits/records/legacyrecord.json
- name: Validate JSON
shell: Rscript {0}
run: |
library(jsonvalidate);
validate <- jsonvalidate::json_validator('schema.json')
z <- tryCatch(validate('.zenodo.json',
verbose = TRUE,
error = FALSE,
greedy = TRUE),
error = function(e) e
)
if(!z){
errs <- attr(z, "errors", TRUE)
msg <- sprintf("'%s' %s",
errs$field,
errs$message)
cat(paste(msg, collapse = "\n"))
cat("\n")
stop("json validation failed", call. = FALSE)
}
41 changes: 0 additions & 41 deletions .github/workflows/yearly-release.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.RData
.Ruserdata
.markdrive
schema.json
120 changes: 120 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"title": "R-Ladies organizational guidance",

"description": "Source content for R-Ladies organizational guidance",

"keywords": ["operational guide", "community guide"],

"license": "cc-by-4.0",

"communities": [{"identifier": "rladies"}],

"creators": [
{
"name": "R-Ladies Global Team",
"affiliation": "R-Ladies Global"
},
{
"name": "Salmon, Maëlle",
"affiliation": "@ropensci",
"orcid": "0000-0002-2815-0399"
},
{
"name": "Simeon, Katherine",
"orcid": "0000-0002-0170-5585"
},
{
"name": "Pileggi, Shannon",
"affiliation": "The Prostate Cancer Clinical Trials Consortium",
"orcid": "0000-0002-7732-4164"
},
{
"name": "Mowinckel, Athanasia Monika",
"affiliation": "@LCBC-UiO",
"orcid": "0000-0002-5756-0223"
},
{
"name": "Saibene, Yanina Bellini",
"affiliation": "@ropensci",
"orcid": "0000-0002-4522-7466"
},
{
"name": "LeDell, Erin",
"affiliation": "@h2oai"
},
{
"name": "Quiroga, Riva",
"orcid": "0000-0002-1147-4135"
},
{
"name": "Frick, Hannah",
"orcid": "0000-0002-6049-5258"
},
{
"name": "Gazzelloni, Federica",
"affiliation": "Data Scientist",
"orcid": "0000-0002-4285-611X"
},
{
"name": "Saia, Sheila",
"affiliation": "Tetra Tech",
"orcid": "0000-0002-4943-0306"
},
{
"name": "Almarzouq, Batool",
"orcid": "0000-0002-3905-2751"
},
{
"name": "Thompson, Jennifer"
},
{
"name": "Vitolo, Claudia",
"orcid": "0000-0002-4252-1176"
},
{
"name": "Rüegger, Sina",
"orcid": "0009-0000-7190-9922"
},
{
"name": "Acion, Laura",
"orcid": "0000-0001-5213-6012"
},
{
"name": "de Quieroz, Gabriela"
},
{
"name": "Belaid, Mouna"
},
{
"name": "Daish, Alice"
},
{
"name": "Mostipak, Jesse"
},
{
"name": "Loto, Patricia A."
},
{
"name": "Vazquez, Daniela",
"orcid": "0000-0001-8016-1469"
},
{
"name": "Columbus, Alyssa"
},
{
"name": "Ravi, Janani",
"orcid": "0000-0001-7443-925X"
},
{
"name": "Hernández, Bea"
},
{
"name": "Sero, Nadejda B",
"orcid": "0000-0002-3569-2014"
},
{
"name": "D'Andrea, Florencia",
"orcid": "0000-0002-0041-097X"
}
]
}
Loading

0 comments on commit 3ab4970

Please sign in to comment.