Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODELIST_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
94
17 changes: 8 additions & 9 deletions .github/workflows/check-codelist-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

permissions:
contents: read
contents: write
issues: write

jobs:
Expand All @@ -22,7 +22,7 @@ jobs:

- name: Check if biweek (only run on even weeks)
run: |
week=${{ steps.week.outputs.week }}
week="${{ steps.week.outputs.week }}"
if [ $((10#$week % 2)) -ne 0 ]; then
echo "Skipping - odd week ($week)"
exit 0
Expand All @@ -40,8 +40,7 @@ jobs:
# Get the full line containing the highest version, then extract the date
# Format: "* Mar 2, 2026 - Version 94 of the ENTSO-E Code list is published."
line=$(echo "$response" | grep "Version $version " | head -1)
date=$(echo "$line" | grep -oP '[A-Z][a-z]{2}\s+\d{1,2},\s+\d{4} | head -1')
date=$(echo $date | head -1)
date=$(echo "$line" | grep -oP '[A-Z][a-z]{2}\s+\d{1,2},\s+\d{4}' | head -1)

if [ -z "$version" ]; then
echo "Failed to extract version number"
Expand All @@ -68,7 +67,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=${{ steps.fetch.outputs.version }}
version="${{ steps.fetch.outputs.version }}"

# Search for existing issues about this version
existing=$(gh issue list --state open --search "Code List Version $version" --json number --jq '.[0].number')
Expand All @@ -85,9 +84,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=${{ steps.fetch.outputs.version }}
date=${{ steps.fetch.outputs.date }}
stored_version=${{ steps.stored.outputs.stored_version }}
version="${{ steps.fetch.outputs.version }}"
date="${{ steps.fetch.outputs.date }}"
stored_version="${{ steps.stored.outputs.stored_version }}"

if [ "$version" -gt "$stored_version" ]; then
gh issue create \
Expand All @@ -111,7 +110,7 @@ jobs:
- name: Update stored version
if: steps.check.outputs.exists == 'false'
run: |
version=${{ steps.fetch.outputs.version }}
version="${{ steps.fetch.outputs.version }}"
echo "$version" > .github/CODELIST_VERSION

- name: Commit updated version file
Expand Down
Loading