Added git info script
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 30s

This commit is contained in:
Matthias Heisig
2025-06-03 10:56:17 +02:00
parent 7a6dfffc87
commit c91bd1447d
2 changed files with 25 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ gitea.repository }} repository has been cloned to the runner."
- run: create_git_info_file.sh
- run: echo "Starting first LaTeX build"
- run: pdflatex fat.tex
- run: echo "Starting second LaTeX build"

24
create_git_info_file.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Get the first tag found in the history from the current HEAD
FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null)
# Get the first tag in history that looks like a Release
RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null)
# Hoover up the metadata
git --no-pager log -1 --date=short --decorate=short \
--pretty=format:"\usepackage[%
shash={%h},
lhash={%H},
authname={%an},
authemail={%ae},
authsdate={%ad},
authidate={%ai},
authudate={%at},
commname={%cn},
commemail={%ce},
commsdate={%cd},
commidate={%ci},
commudate={%ct},
refnames={%d},
firsttagdescribe={$FIRSTTAG},
reltag={$RELTAG}
]{gitexinfo}" HEAD > .git/gitHeadInfo.gin