diff --git a/.github/ISSUE_TEMPLATE/issue_template_user_kudos.md b/.github/ISSUE_TEMPLATE/issue_template_user_kudos.md new file mode 100644 index 00000000..39fb7b5c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue_template_user_kudos.md @@ -0,0 +1,23 @@ +--- +name: User Kudos +about: Share appreciation for the project! +title: Add new user to USERS.cff +labels: user +assignees: '' + +--- + +Thanks for supporting the project and helping to improve its recognition by joining USERS.cff. +It helps the project quite a bit! + +We will add you to the list of valued users. + +Please, insert your information between the double quotes below - fill out at minimum "affiliation" :purple_heart: + +family-names: "" +given-names: "" +alias: "" +affiliation: "" +orcid: "" + +Thank you! diff --git a/.github/workflows/extend_user_cff.yml b/.github/workflows/extend_user_cff.yml new file mode 100644 index 00000000..593b90ef --- /dev/null +++ b/.github/workflows/extend_user_cff.yml @@ -0,0 +1,88 @@ +name: create-pr-to-add-user-to-usercff + +on: + workflow_dispatch: + issues: + types: [opened, labeled] + +permissions: + contents: write + pull-requests: write + +jobs: + create-pr-to-add-new-user: + if: contains(join(github.event.issue.labels.*.name, ','), 'user') + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + # checkout to develop branch of repo + ref: develop + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Extract issue details + id: extract_details + run: | + echo "Extracting issue details..." + ISSUE_BODY="${{ github.event.issue.body }}" + echo "Issue body content:" + echo "$ISSUE_BODY" + + # Extract information + FAMILY_NAMES=$(echo "$ISSUE_BODY" | grep '^family-names:' | sed 's/family-names: //') + GIVEN_NAMES=$(echo "$ISSUE_BODY" | grep '^given-names:' | sed 's/given-names: //') + ALIAS=$(echo "$ISSUE_BODY" | grep '^alias:' | sed 's/alias: //') + AFFILIATION=$(echo "$ISSUE_BODY" | grep '^affiliation:' | sed 's/affiliation: //') + ORCID=$(echo "$ISSUE_BODY" | grep '^orcid:' | sed 's/orcid: //') + + # Delete new lines and add to env variables + echo "FAMILY_NAMES=$(echo -n $FAMILY_NAMES | tr -d '\n')" >> $GITHUB_ENV + echo "GIVEN_NAMES=$(echo -n $GIVEN_NAMES | tr -d '\n')" >> $GITHUB_ENV + echo "ALIAS=$(echo -n $ALIAS | tr -d '\n')" >> $GITHUB_ENV + echo "AFFILIATION=$(echo -n $AFFILIATION | tr -d '\n')" >> $GITHUB_ENV + echo "ORCID=$(echo -n $ORCID | tr -d '\n')" >> $GITHUB_ENV + + - name: Debug extracted values + run: | + echo "Family Names: ${{env.FAMILY_NAMES}}" + echo "Given Names: ${{env.GIVEN_NAMES}}" + echo "Alias: ${{env.ALIAS}}" + echo "Affiliation: ${{env.AFFILIATION}}" + echo "ORCID: ${{env.ORCID}}" + + - name: Update USERS.cff + run: | + # double quotes are not added, due to formatting hell. Double quotes will cause the creation of additional unwanted new lines, even when checked out as \" + tee -a USERS.cff <