test: Add secret priority test and fix Forgejo workflow variables

- Add test step to check TEST_SECRET priority (user: apple, org: pear, repo: pumpkin)
- Fix build number variable from GITHUB_RUN_NUMBER to ACTIONS_RUN_NUMBER
- Fix commit hash to use full hash instead of truncated version
- Add clear comments explaining Forgejo-specific variables
- This will help resolve the package versioning mismatch issue
This commit is contained in:
robojerk 2025-08-16 19:37:46 -07:00
parent c098a6b21e
commit ec0da91864

View file

@ -21,6 +21,14 @@ jobs:
image: rust:trixie
steps:
- name: Test secret priority
run: |
echo "Testing secret priority:"
echo "TEST_SECRET value: ${{ secrets.TEST_SECRET }}"
echo "User level: apple"
echo "Org level: pear"
echo "Repo level: pumpkin"
- name: Setup environment
run: |
# Try apt-cacher-ng first, fallback to Debian's automatic mirror selection
@ -107,8 +115,9 @@ jobs:
echo "Building Debian package..."
# Get build information for versioning
BUILD_NUMBER="${GITHUB_RUN_NUMBER:-$(date +%s)}"
COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
# Forgejo/Gitea Actions uses ACTIONS_RUN_NUMBER, fallback to timestamp
BUILD_NUMBER="${ACTIONS_RUN_NUMBER:-$(date +%s)}"
COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
BUILD_VERSION="0.1.0+build${BUILD_NUMBER}.${COMMIT_HASH}"
echo "Build Version: $BUILD_VERSION"
@ -455,8 +464,9 @@ jobs:
fi
# Get build info for registry
BUILD_NUMBER="${GITHUB_RUN_NUMBER:-$(date +%s)}"
COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
# Forgejo/Gitea Actions uses ACTIONS_RUN_NUMBER, fallback to timestamp
BUILD_NUMBER="${ACTIONS_RUN_NUMBER:-$(date +%s)}"
COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
echo "Publishing packages for build $BUILD_NUMBER (commit $COMMIT_HASH)"