Skip to content

Commit

Permalink
feat: Add three points
Browse files Browse the repository at this point in the history
  • Loading branch information
rockyj committed Jan 9, 2025
1 parent 2056ef9 commit 94f0c7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/env_approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,26 @@ jobs:
run: |
SERVICES=()
echo "Checking for changes..."
echo "Comparing: ${{ github.event.before }} -> ${{ github.sha }}"
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^src/"; then
echo "Found changes in frontend (src/)"
SERVICES+=("frontend")
fi
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q "^backend/"; then
echo "Found changes in backend (backend/)"
SERVICES+=("backend")
fi
echo "Detected services: ${SERVICES[*]}"
if [ ${#SERVICES[@]} -eq 0 ]; then
echo "No services affected"
echo "services=[]" >> $GITHUB_OUTPUT
else
JSON_ARRAY=$(printf '%s\n' "${SERVICES[@]}" | jq -R . | jq -s . | jq -c .)
echo "Final JSON output: ${JSON_ARRAY}"
echo "services=${JSON_ARRAY}" >> $GITHUB_OUTPUT
fi
Expand Down
2 changes: 1 addition & 1 deletion backend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const PORT = process.env.PORT || 3000;

// 触发GitHub repository dispatch事件的函数
async function triggerGithubDispatch(owner, repo, token) {
console.log(`[${new Date().toISOString()}] 开始触发GitHub Dispatch事件..`);
console.log(`[${new Date().toISOString()}] 开始触发GitHub Dispatch事件...`);
console.log(`[${new Date().toISOString()}] 目标仓库: ${owner}/${repo}`);

try {
Expand Down

0 comments on commit 94f0c7c

Please sign in to comment.