Workflow Failure Attempt to fix 1
Some checks failed
Generate Build Info / build-info (push) Failing after 30s
Some checks failed
Generate Build Info / build-info (push) Failing after 30s
This commit is contained in:
@@ -1,22 +1,17 @@
|
|||||||
name: Generate Build Info (Commit Hash)
|
name: Generate Build Info
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-info:
|
build-info:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout repo
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -26,28 +21,27 @@ jobs:
|
|||||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
DATE=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
|
DATE=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
|
||||||
|
|
||||||
mkdir -p dapper # Ensure folder exists
|
mkdir -p dapper
|
||||||
|
|
||||||
cat > dapper/build-info.php << EOF
|
cat > dapper/build-info.php << EOF
|
||||||
<?php
|
<?php
|
||||||
// Auto-generated build metadata - DO NOT EDIT manually
|
|
||||||
// Generated on: $DATE
|
|
||||||
return [
|
return [
|
||||||
'commit' => '$SHORT_HASH',
|
'commit' => '$SHORT_HASH',
|
||||||
'branch' => '$BRANCH',
|
'branch' => '$BRANCH',
|
||||||
'built' => '$DATE',
|
'built' => '$DATE',
|
||||||
];
|
];
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Generated build-info.php with commit $SHORT_HASH"
|
- name: Commit file
|
||||||
|
run: |
|
||||||
|
git config --global user.name "Gitea Runner"
|
||||||
|
git config --global user.email "ampedlease@ampedlease.com"
|
||||||
|
|
||||||
- name: Commit build-info.php if changed
|
git add dapper/build-info.php
|
||||||
uses: https://github.com/stefanzweifel/git-auto-commit-action@v5
|
|
||||||
with:
|
if git diff --cached --quiet; then
|
||||||
commit_message: "chore: update build-info.php [ci skip]"
|
echo "No changes to commit"
|
||||||
file_pattern: dapper/build-info.php
|
else
|
||||||
skip_fetch: true
|
git commit -m "auto: update build info [skip ci]"
|
||||||
skip_checkout: true
|
git push
|
||||||
commit_user_name: "Automated Build"
|
fi
|
||||||
commit_user_email: "ampedlease@ampedlease.com"
|
|
||||||
commit_author: "Automated Build <ampedlease@ampedlease.com>"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user