From c18b13549ec6a3c4a7236719de6e20ca4770fcdd Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 13 Aug 2025 17:47:53 -0700 Subject: [PATCH] Fix Forgejo Actions compatibility issues - Replace forge.* context variables with shell commands to avoid compatibility issues - Use 1755132473 for build IDs instead of forge.run_number - Use git commands for commit and branch information instead of forge context - Simplify workflow dependencies to avoid potential parsing issues - Make workflows more robust and compatible with Forgejo Actions --- .forgejo/workflows/build.yml | 6 +++--- .forgejo/workflows/ci.yml | 6 +++--- .forgejo/workflows/test.yml | 6 +++--- .forgejo/workflows/update-readme.yml | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 6dbc35a3..daccceb1 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -412,9 +412,9 @@ jobs: ## Build Information - **Build Date**: $(date '+%Y-%m-%d %H:%M:%S UTC') - - **Build ID**: ${{ forge.run_number }} - - **Commit**: ${{ forge.sha }} - - **Branch**: ${{ forge.ref_name }} + - **Build ID**: $(date +%s) + - **Commit**: $(git rev-parse --short HEAD 2>/dev/null || echo "Unknown") + - **Branch**: $(git branch --show-current 2>/dev/null || echo "Unknown") ## Build Status - **Status**: ✅ SUCCESS diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 10b20094..c56d6c1a 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -217,9 +217,9 @@ jobs: ## Build Information - **Build Date**: $(date '+%Y-%m-%d %H:%M:%S UTC') - - **Build ID**: ${{ forge.run_number }} - - **Commit**: ${{ forge.sha }} - - **Branch**: ${{ forge.ref_name }} + - **Build ID**: $(date +%s) + - **Commit**: $(git rev-parse --short HEAD 2>/dev/null || echo "Unknown") + - **Branch**: $(git branch --show-current 2>/dev/null || echo "Unknown") ## Job Results - **Build and Test**: ${{ needs.build-and-test.result }} diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 033575f7..9fd197fa 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -204,9 +204,9 @@ jobs: ## Test Information - **Test Date**: $(date '+%Y-%m-%d %H:%M:%S UTC') - - **Test ID**: ${{ forge.run_number }} - - **Commit**: ${{ forge.sha }} - - **Branch**: ${{ forge.ref_name }} + - **Test ID**: $(date +%s) + - **Commit**: $(git rev-parse --short HEAD 2>/dev/null || echo "Unknown") + - **Branch**: $(git branch --show-current 2>/dev/null || echo "Unknown") ## Test Status - **Status**: ✅ SUCCESS diff --git a/.forgejo/workflows/update-readme.yml b/.forgejo/workflows/update-readme.yml index 96d29ec9..aff62fd8 100644 --- a/.forgejo/workflows/update-readme.yml +++ b/.forgejo/workflows/update-readme.yml @@ -60,7 +60,7 @@ jobs: run: | # Get current date and workflow run ID BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S UTC') - WORKFLOW_RUN_ID=${{ forge.run_number }} + WORKFLOW_RUN_ID=$(date +%s) echo "Updating README with workflow run ID: $WORKFLOW_RUN_ID" @@ -72,18 +72,18 @@ jobs: **Last Built**: $BUILD_DATE **Version**: 0.1.0-1 **Target**: Debian Stable - **Build ID**: [$WORKFLOW_RUN_ID](https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID) + **Build ID**: $WORKFLOW_RUN_ID ### Download Links - - **apt-ostree_0.1.0-1_amd64.deb** - [Download from Build $WORKFLOW_RUN_ID](https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID) - - **apt-ostree-dbgsym_0.1.0-1_amd64.ddeb** - [Download from Build $WORKFLOW_RUN_ID](https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID) + - **apt-ostree_0.1.0-1_amd64.deb** - Build $WORKFLOW_RUN_ID + - **apt-ostree-dbgsym_0.1.0-1_amd64.ddeb** - Build $WORKFLOW_RUN_ID ### Quick Installation \`\`\`bash # Download and install the package - # Visit: https://git.raines.xyz/robojerk/apt-ostree/actions/runs/$WORKFLOW_RUN_ID + # Build ID: $WORKFLOW_RUN_ID # Download the .deb files and run: sudo dpkg -i apt-ostree_0.1.0-1_amd64.deb sudo apt-get install -f # Install any missing dependencies @@ -135,7 +135,7 @@ jobs: # Add and commit changes git add README.md - git commit -m "Update README with download links for build ${{ forge.run_number }}" + git commit -m "Update README with download links for build $(date +%s)" # Push changes git push origin main @@ -150,7 +150,7 @@ jobs: ## Update Information - **Update Date**: $(date '+%Y-%m-%d %H:%M:%S UTC') - - **Triggered by**: Build workflow ${{ forge.run_number }} + - **Triggered by**: Build workflow $(date +%s) - **Status**: ✅ SUCCESS ## Changes Made