Skip to content

Commit dda5dbb

Browse files
committed
Change snapshot branches name
Signed-off-by: Nicolas Rol <[email protected]>
1 parent 9bd2aea commit dda5dbb

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

Diff for: .github/workflows/scripts/check_integration_branch.sh

-17
This file was deleted.

Diff for: .github/workflows/scripts/check_snapshot_branch.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
repo=$1
4+
core_version=$2
5+
6+
# Add "-SNAPSHOT" to powsybl-core version if not already there
7+
core_snapshot_version=$(echo "$core_version" | grep -q SNAPSHOT && echo "$core_version" || echo "$core_version-SNAPSHOT")
8+
9+
# Find if a CI snapshot branch exists
10+
SNAPSHOT_BRANCH=$(git ls-remote --heads "$repo" | grep -E "refs/heads/ci/core-$core_snapshot_version" | sed 's/.*refs\/heads\///')
11+
if [ -n "$SNAPSHOT_BRANCH" ]; then
12+
echo "SNAPSHOT VERSION EXIST: $SNAPSHOT_BRANCH"
13+
echo "SNAPSHOT_BRANCH=$SNAPSHOT_BRANCH" >> "$GITHUB_ENV"
14+
else
15+
echo "No SNAPSHOT branch found"
16+
echo "SNAPSHOT_BRANCH=main" >> "$GITHUB_ENV"
17+
fi

Diff for: .github/workflows/snapshot-ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
working-directory: ./powsybl-core
5757

5858
# Checkout script
59-
# The script check_integration_branch.sh is located in the workflow folder of the repository
59+
# The script check_snapshot_branch.sh is located in the workflow folder of the repository
6060
# It is necessary for checking out the integration branch if it exists
6161
- name: Checkout script
6262
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -68,13 +68,13 @@ jobs:
6868

6969
# Build powsybl-metrix
7070
- name: Checking for powsybl-metrix snapshot branch
71-
run: ${{ env.SCRIPTS_PATH }}/check_integration_branch.sh "https://github.com/powsybl/powsybl-metrix.git" ${{ env.CORE_VERSION }}
71+
run: ${{ env.SCRIPTS_PATH }}/check_snapshot_branch.sh "https://github.com/powsybl/powsybl-metrix.git" ${{ env.CORE_VERSION }}
7272

7373
- name: Checkout powsybl-metrix
7474
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7575
with:
7676
repository: powsybl/powsybl-metrix
77-
ref: ${{ env.INTEGRATION_BRANCH }}
77+
ref: ${{ env.SNAPSHOT_BRANCH }}
7878
path: powsybl-metrix
7979
submodules: true
8080

@@ -164,7 +164,7 @@ jobs:
164164

165165
outputs:
166166
core-version: ${{ env.CORE_VERSION }}
167-
metrix-branch: ${{ env.INTEGRATION_BRANCH }}
167+
metrix-branch: ${{ env.SNAPSHOT_BRANCH }}
168168

169169
# Slack notification on failure
170170
notify_slack:

0 commit comments

Comments
 (0)