Skip to content

Commit 7c91d59

Browse files
author
GitHub Actions
committed
Improve repository URL configuration using GitHub Actions context variables
- Replace hardcoded REPO_URL in config.sh with dynamic GitHub variables - Use GITHUB_SERVER_URL and GITHUB_REPOSITORY context variables in workflow - Add fallback values for local development compatibility - Make configuration more portable and maintainable
1 parent 33d490c commit 7c91d59

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/scripts/config.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
# Navigation Links
66
SHOP_URL="https://uelectronics.com/"
7-
REPO_URL="https://github.com/UNIT-Electronics-MX/unit_jun_r3_development_board"
7+
# Use GitHub Actions context variable if available, fallback to hardcoded URL
8+
REPO_URL="${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY:-UNIT-Electronics-MX/unit_devlab_i2c_bme688_environmental_4_in_1_sensor}"
89

910
# Icons (using Unicode emojis)
1011
SHOP_ICON="🛒"

.github/workflows/deploy-mdbook.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ jobs:
5151
mdbook-version: '0.4.52'
5252

5353
- name: Build documentation with configurable navbar
54+
env:
55+
GITHUB_SERVER_URL: ${{ github.server_url }}
56+
GITHUB_REPOSITORY: ${{ github.repository }}
5457
run: |
5558
echo "Building documentation using modular scripts..."
59+
echo "Repository URL will be: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
60+
5661
# Load configuration and build with navbar injection
5762
source .github/scripts/config.sh
5863
python3 .github/scripts/build_docs.py

0 commit comments

Comments
 (0)