Skip to content

Commit c122d74

Browse files
let's verify the tags and make sure the fetch depth is 0
1 parent 84e1add commit c122d74

File tree

2 files changed

+16
-30
lines changed

2 files changed

+16
-30
lines changed

.github/workflows/build-umu-fedora-40.yml

+8-15
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,23 @@ jobs:
1717
image: fedora:40
1818

1919
steps:
20-
- name: Install Git
21-
run: dnf install -y git
22-
2320
- name: Checkout repository
2421
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install Git
26+
run: |
27+
dnf install -y git
28+
git fetch --tags --force
29+
git verify-tag $(git describe --tags --abbrev=0)
2530
2631
- name: Configure Git safe directory
2732
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2833

2934
- name: Install build dependencies
3035
run: dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel
3136

32-
- name: Extract Version and SHA
33-
run: |
34-
# Get version from git tags (assuming semantic versioning format)
35-
VERSION=$(git describe --tags --abbrev=0 || echo "unknown")
36-
37-
# Get current commit SHA
38-
COMMIT_SHA=$(git rev-parse HEAD)
39-
40-
# Store values in environment file
41-
echo "VERSION=$VERSION" >> $GITHUB_ENV
42-
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
43-
4437
- name: Build the project
4538
run: |
4639
git submodule update --init --recursive

.github/workflows/build-umu-fedora-41.yml

+8-15
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,23 @@ jobs:
1717
image: fedora:41
1818

1919
steps:
20-
- name: Install Git
21-
run: dnf install -y git
22-
2320
- name: Checkout repository
2421
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install Git
26+
run: |
27+
dnf install -y git
28+
git fetch --tags --force
29+
git verify-tag $(git describe --tags --abbrev=0)
2530
2631
- name: Configure Git safe directory
2732
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2833

2934
- name: Install build dependencies
3035
run: dnf install -y rpm-build meson ninja-build cmake g++ gcc-c++ scdoc git python3-devel python3-build python3-installer python3-hatchling python python3 cargo python3-hatch-vcs python3-wheel libzstd-devel
3136

32-
- name: Extract Version and SHA
33-
run: |
34-
# Get version from git tags (assuming semantic versioning format)
35-
VERSION=$(git describe --tags --abbrev=0 || echo "unknown")
36-
37-
# Get current commit SHA
38-
COMMIT_SHA=$(git rev-parse HEAD)
39-
40-
# Store values in environment file
41-
echo "VERSION=$VERSION" >> $GITHUB_ENV
42-
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
43-
4437
- name: Build the project
4538
run: |
4639
git submodule update --init --recursive

0 commit comments

Comments
 (0)