Files
Dapper/.gitea/workflows/generate-build-info.yml
carpentryplus25 328bb9eacf
All checks were successful
Generate Build Info / build-info (push) Successful in 1s
Workflow Failure Attempt to fix 3
2026-03-05 10:19:51 -05:00

55 lines
1.3 KiB
YAML

name: Generate Build Info
on:
push:
branches:
- main
jobs:
build-info:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
run: |
git clone https://git.thejthompson.com/williamt/Dapper repo
cd repo
git checkout main
- name: Generate build-info.php
run: |
cd repo
SHORT_HASH=$(git rev-parse --short HEAD)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
DATE=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
mkdir -p dapper
cat > dapper/build-info.php << EOF
<?php
return [
'commit' => '$SHORT_HASH',
'branch' => '$BRANCH',
'built' => '$DATE',
];
EOF
- name: Commit build info
env:
TOKEN: ${{ secrets.DAPPER_TOKEN }}
run: |
cd repo
git config user.name "Gitea Runner"
git config user.email "ampedlease@ampedlease.com"
git add dapper/build-info.php
if git diff --cached --quiet; then
echo "No changes"
else
git commit -m "auto: update build info [skip ci]"
git push https://williamt:${TOKEN}@git.thejthompson.com/williamt/Dapper.git
fi