Skip to content

Commit

Permalink
feat: add issue and PR templated
Browse files Browse the repository at this point in the history
  • Loading branch information
kshychko committed Feb 13, 2024
1 parent 63f0c9e commit 0918274
Show file tree
Hide file tree
Showing 8 changed files with 290 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/recommendation-20-maintenance-request .md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Recommendation 20 Maintenance Request
about: This issue template allows to raise a maintenance requestion for Recommendation
20 Code List
title: "[Rec20 MR]"
labels: MR, Rec-20
assignees: kshychko

---
## Maintenance Request details
<!-- Please describe the details of the maintenance request you are raising including the reason -->
Status:
Common Code:
Name:
Description:
Level/Category:
Symbol:
Conversion Factor


Reason:

## Related Pull Request
<!-- Add a reference to a corresponding Pull Request -->
PR #{PR_number}

## Additional context
<!-- Add any other context or screenshots about the feature request here -->

### Mentions:
<!--- Keep maintainers team mentioned and add more mentions if needed -->

@uncefact/vocab-codes-maintainers
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/recommendation-21-maintenance-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Recommendation 21 Maintenance Request
about: This issue template allows to raise a maintenance requestion for Recommendation
21 Code List
title: "[Rec21 MR]"
labels: MR, Rec-21
assignees: kshychko

---
## Maintenance Request details
<!-- Please describe the details of the maintenance request you are raising including the reason -->
Status:
Code:
Name:
Description:
Numeric code:


Reason:

## Related Pull Request
<!-- Add a reference to a corresponding Pull Request -->
PR #{PR_number}

## Additional context
<!-- Add any other context or screenshots about the feature request here -->

### Mentions:
<!--- Keep maintainers team mentioned and add more mentions if needed -->

@uncefact/vocab-codes-maintainers
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/recommendation-23-maintenance-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Recommendation 23 Maintenance Request
about: This issue template allows to raise a maintenance requestion for Recommendation
23 Code List
title: "[Rec23 MR]"
labels: MR, Rec-23
assignees: kshychko

---
## Maintenance Request details
<!-- Please describe the details of the maintenance request you are raising including the reason -->
CI:
Group:
Subgroup:
Detail:
Description:
Mode/Site Indicator:
Duplicate Indicator:

Reason:

## Related Pull Request
<!-- Add a reference to a corresponding Pull Request -->
PR #{PR_number}

## Additional context
<!-- Add any other context or screenshots about the feature request here -->

### Mentions:
<!--- Keep maintainers team mentioned and add more mentions if needed -->
@uncefact/vocab-codes-maintainers
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ CI:
Code:
Name:
Description:


Reason:

## Related Pull Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: kshychko
---
## Maintenance Request details
<!-- Please describe the details of the maintenance request you are raising including the reason -->
CI:
STATUS:
Code:
Name:
Description:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/pull-request-20.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Diff code list 20

on:
pull_request:
paths:
- 'CLR/Rec20/current/Annex || & Annex |||/code-list.csv'

jobs:
diff:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |-
pip install csv-diff
- name: Fetch latest data
run: |-
cp "CLR/Rec20/current/Annex || & Annex |||/code-list.csv" code-list-new.csv
curl -o code-list-old.csv "https://raw.githubusercontent.com/uncefact/vocab-codes/main/CLR/Rec20/current/code-list.csv"
# Remove heading line and use it to start a new file
## todo: check if need sorting, simple sort isn't working because CI is the first column
#head -n 1 code-list-new.csv > code-list-new-sorted.csv
## Sort all but the first line and append to that file
#tail -n +2 "code-list-new.csv" | sort >> code-list-new-sorted.csv
# Generate commit message using csv-diff
csv-diff code-list-old.csv code-list-new.csv --key=Code --singular=record --plural=records > message.txt
cat message.txt
# todo: add check for message.txt content
#mv code-list-new.csv "CRL/Rec20/current/Annex || & Annex |||/code-list.csv"
- name: Set variables
if: ${{ hashFiles('message.txt') != '' }}
run: |
MSG=$(cat message.txt)
echo "MESSAGE=$MSG" >> $GITHUB_ENV
- name: Comment a pull_request
if: ${{ hashFiles('message.txt') != '' }}
uses: mb2dev/[email protected]
with:
message: |
message:
${{ env.MESSAGE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add "CLR/Rec20/current/"
timestamp=$(date -u)
git commit -F message.txt || exit 0
git push
64 changes: 64 additions & 0 deletions .github/workflows/pull-request-21.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Diff code list 21

on:
pull_request:
paths:
- 'CLR/Rec21/current/code-list.csv'

jobs:
diff:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |-
pip install csv-diff
- name: Fetch latest data
run: |-
cp "CLR/Rec21/current/code-list.csv" code-list-new.csv
curl -o code-list-old.csv "https://raw.githubusercontent.com/uncefact/vocab-codes/main/CLR/Rec21/current/code-list.csv"
# Remove heading line and use it to start a new file
## todo: check if need sorting, simple sort isn't working because CI is the first column
#head -n 1 code-list-new.csv > code-list-new-sorted.csv
## Sort all but the first line and append to that file
#tail -n +2 "code-list-new.csv" | sort >> code-list-new-sorted.csv
# Generate commit message using csv-diff
csv-diff code-list-old.csv code-list-new.csv --key=Code --singular=record --plural=records > message.txt
cat message.txt
# todo: add check for message.txt content
#mv code-list-new.csv "CRL/Rec21/current/code-list.csv"
- name: Set variables
if: ${{ hashFiles('message.txt') != '' }}
run: |
MSG=$(cat message.txt)
echo "MESSAGE=$MSG" >> $GITHUB_ENV
- name: Comment a pull_request
if: ${{ hashFiles('message.txt') != '' }}
uses: mb2dev/[email protected]
with:
message: |
message:
${{ env.MESSAGE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add "CLR/Rec21/current/code-list.csv"
timestamp=$(date -u)
git commit -F message.txt || exit 0
git push
64 changes: 64 additions & 0 deletions .github/workflows/pull-request-23.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Diff code list 23

on:
pull_request:
paths:
- 'CLR/Rec23/current/code-list.csv'

jobs:
diff:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |-
pip install csv-diff
- name: Fetch latest data
run: |-
cp "CLR/Rec23/current/code-list.csv" code-list-new.csv
curl -o code-list-old.csv "https://raw.githubusercontent.com/uncefact/vocab-codes/main/CLR/Rec23/current/code-list.csv"
# Remove heading line and use it to start a new file
## todo: check if need sorting, simple sort isn't working because CI is the first column
#head -n 1 code-list-new.csv > code-list-new-sorted.csv
## Sort all but the first line and append to that file
#tail -n +2 "code-list-new.csv" | sort >> code-list-new-sorted.csv
# Generate commit message using csv-diff
csv-diff code-list-old.csv code-list-new.csv --key=Code --singular=record --plural=records > message.txt
cat message.txt
# todo: add check for message.txt content
#mv code-list-new.csv "CRL/Rec23/current/code-list.csv"
- name: Set variables
if: ${{ hashFiles('message.txt') != '' }}
run: |
MSG=$(cat message.txt)
echo "MESSAGE=$MSG" >> $GITHUB_ENV
- name: Comment a pull_request
if: ${{ hashFiles('message.txt') != '' }}
uses: mb2dev/[email protected]
with:
message: |
message:
${{ env.MESSAGE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add "CLR/Rec23/current/code-list.csv"
timestamp=$(date -u)
git commit -F message.txt || exit 0
git push

0 comments on commit 0918274

Please sign in to comment.