From 3a6ff6ecdb1c0921a8baf1ab8044beb007e5a0d7 Mon Sep 17 00:00:00 2001 From: chrwm <54852694+chrwm@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:41:32 +0200 Subject: [PATCH 1/6] Create issue_template_user_kudos.md --- .../issue_template_user_kudos.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/issue_template_user_kudos.md 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! From 326558f648add971304b59473fe849c838e8e26d Mon Sep 17 00:00:00 2001 From: chrwm <54852694+chrwm@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:42:54 +0200 Subject: [PATCH 2/6] Create extend_user_cff.yml #528 --- .github/workflows/extend_user_cff.yml | 88 +++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/extend_user_cff.yml diff --git a/.github/workflows/extend_user_cff.yml b/.github/workflows/extend_user_cff.yml new file mode 100644 index 00000000..79f09ed7 --- /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 < Date: Mon, 3 Jun 2024 23:43:59 +0200 Subject: [PATCH 3/6] Update USERS.cff #528 --- USERS.cff | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/USERS.cff b/USERS.cff index 31f22352..0527701d 100644 --- a/USERS.cff +++ b/USERS.cff @@ -1,8 +1,8 @@ cff-version: 1.2.0 message: "If you use this software, please leave your name for reference. authors: - - family-names: "" - given-names: "" - alias: "" - affiliation: "Reiner Lemoine Institut" - orcid: "" + - family-names: + given-names: + alias: + affiliation: Reiner Lemoine Institut + orcid: From d72058d76de980eca7a4cd30a01070bae78ac6ba Mon Sep 17 00:00:00 2001 From: chrwm <54852694+chrwm@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:49:50 +0200 Subject: [PATCH 4/6] Update extend_user_cff.yml --- .github/workflows/extend_user_cff.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extend_user_cff.yml b/.github/workflows/extend_user_cff.yml index 79f09ed7..593b90ef 100644 --- a/.github/workflows/extend_user_cff.yml +++ b/.github/workflows/extend_user_cff.yml @@ -75,7 +75,7 @@ jobs: uses: peter-evans/create-pull-request@v6 with: base: develop - head: workflow-update-users-cff + head: workflow-${{ github.event.issue.number }}-update-users-cff branch: workflow-${{ github.event.issue.number }}-update-users-cff title: 'Update USERS.cff with new user information' commit-message: | From 6759567163e5759da2b3569cd2c2f4aadc1c49f2 Mon Sep 17 00:00:00 2001 From: chrwm <54852694+chrwm@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:57:35 +0200 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bff50e2..762fdd9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and the versioning aims to respect [Semantic Versioning](http://semver.org/spec/ ### Added - Extend documentation section `getting started` based on the JOSS Review [#523](https://github.com/OpenEnergyPlatform/open-MaStR/pull/523) - Extend and repair documentation based on the JOSS Review [#527](https://github.com/OpenEnergyPlatform/open-MaStR/pull/527) +- Add issue template and workflow to populate USERS.cff [#528](https://github.com/OpenEnergyPlatform/open-MaStR/pull/529) ### Changed - Change License identifier for pypi [#525](https://github.com/OpenEnergyPlatform/open-MaStR/pull/525) - Change header to identify as open-mastr during http request [#526](https://github.com/OpenEnergyPlatform/open-MaStR/pull/526) From 5de19cefc8051e298e75ec5d8071aff14b9e7890 Mon Sep 17 00:00:00 2001 From: chrwm <54852694+chrwm@users.noreply.github.com> Date: Tue, 4 Jun 2024 00:06:55 +0200 Subject: [PATCH 6/6] Link to issue template #528 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5dbf784f..739efdaf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ Please be self-reflective and always maintain a good culture of discussion and a Since the open license allows free use, no notification is required. However, for the authors it is valuable information who uses the software for what purpose. Indicators are `Watch`, `Fork` and `Starred` of the repository. -If you are a user, please add your name and details in [USERS.cff](https://github.com/OpenEnergyPlatform/open-MaStR/blob/production/USERS.cff) +If you are a user, please add your name and details in [USERS.cff](https://github.com/OpenEnergyPlatform/open-MaStR/blob/production/USERS.cff) by using the [issue template](https://github.com/OpenEnergyPlatform/open-MaStR/issues/new?assignees=&labels=user&projects=&template=user-kudos.md&title=Add+new+user+to+USERS.cff). ### B. Comment You can give ideas, hints or report bugs in issues, in PR, at meetings or other channels.