EDI@Energy Changes 2024-07-03 (adds API Guidline and updated EBDs) (#… #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run kohlrAHBi | |
on: | |
push: | |
branches: | |
- master | |
- github_workflow_kohlrahbi_add_cond_packages | |
paths: | |
- 'edi_energy_de/**/*.docx' | |
- 'dependencies/kohlrahbi-requirements.txt' | |
- '.github/workflows/kohlrahbi.yml' | |
jobs: | |
check: | |
name: Parse the Docx Files | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
matrix: | |
format_version: ["FV2104", "FV2110", "FV2210", "FV2304", "FV2310", "FV2404", "FV2410", "FV2504"] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
with: | |
path: edi_energy_mirror | |
lfs: true | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
working-directory: "edi_energy_mirror" | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r dependencies/kohlrahbi-requirements.txt | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.MRAHB_PUSH_TOKEN }} | |
repository: Hochfrequenz/machine-readable_anwendungshandbuecher | |
path: machine-readable_anwendungshandbuecher | |
lfs: true | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.EEAHB_CP_PUSH_TOKEN }} | |
repository: Hochfrequenz/edi_energy_ahb_conditions_and_packages | |
path: edi_energy_ahb_conditions_and_packages | |
lfs: true | |
- name: Run Extraction | |
run: | | |
kohlrahbi ahb --assume-yes --edi-energy-mirror-path edi_energy_mirror --output-path ./machine-readable_anwendungshandbuecher/${{ matrix.format_version }} --format-version ${{ matrix.format_version }} --file-type flatahb --file-type csv --file-type xlsx | |
kohlrahbi conditions --assume-yes --edi-energy-mirror-path edi_energy_mirror --output-path ./edi_energy_ahb_conditions_and_packages/${{ matrix.format_version }} --format-version ${{ matrix.format_version }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install prettier | |
run: npm install prettier -g | |
- name: prettier JSON files | |
run: prettier -w machine-readable_anwendungshandbuecher/${{ matrix.format_version }} | |
- name: Get current time | |
uses: srfrnk/current-time@master | |
id: current-time | |
with: | |
format: YYYY-MM-DDTHH-mm-ss | |
- name: Push flat AHBs to machine-readable_anwendungshandbuecher | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
path: machine-readable_anwendungshandbuecher | |
title: EDI@Energy KohlrAHBi ${{ matrix.format_version }} Changes ${{ steps.current-time.outputs.formattedTime }} | |
token: ${{ secrets.MRAHB_PUSH_TOKEN }} # this token expires on 2025-02-13 | |
# token with repo scope | |
# https://github.com/Hochfrequenz/edi_energy_mirror/settings/secrets/actions/MRAHB_PUSH_TOKEN | |
branch: update-${{ matrix.format_version }}-${{ steps.current-time.outputs.formattedTime }} | |
reviewers: hf-krechan | |
assignees: hf-krechan | |
- name: prettier condition files | |
run: prettier -w edi_energy_ahb_conditions_and_packages | |
- name: Push conditions and packages AHBs to edi energy ahb conditons and packages | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
path: edi_energy_ahb_conditions_and_packages | |
title: EDI@Energy KohlrAHBi ${{ matrix.format_version }} Changes ${{ steps.current-time.outputs.formattedTime }} | |
token: ${{ secrets.EEAHB_CP_PUSH_TOKEN }} # this token expires on yyyy-mm-dd | |
# token with repo scope | |
# https://github.com/Hochfrequenz/edi_energy_mirror/settings/secrets/actions/EEAHB_CP_PUSH_TOKEN | |
branch: update-${{ matrix.format_version }}-${{ steps.current-time.outputs.formattedTime }} | |
reviewers: hf-krechan | |
assignees: hf-krechan, DeltaDaniel |