Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fork-pr-warp-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/registry': patch
---

Fix check-warp-deploy workflow for fork PRs
5 changes: 4 additions & 1 deletion .github/workflows/check-warp-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
# Skip token generation for fork PRs (they don't have access to secrets)
- name: Generate GitHub App Token
id: generate-token
if: github.event.pull_request.head.repo.full_name == github.repository
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.HYPER_GONK_APP_ID }}
Expand All @@ -29,7 +31,8 @@ jobs:

- name: Check Warp Deploy
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
# Only set PR_NUMBER for non-fork PRs (enables PR commenting)
PR_NUMBER: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.number || '' }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
./scripts/check-warp-deploy.sh ${{ steps.determine-base-sha.outputs.base_sha }} ${{ steps.determine-base-sha.outputs.current_sha }}
15 changes: 10 additions & 5 deletions scripts/check-warp-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,19 @@ for WARP_ROUTE_ID in $WARP_ROUTE_IDS; do
JOB_SUMMARY+="| $WARP_ROUTE_ID | $ONCHAIN_STATUS | $CONFIG_SYNC_STATUS |\n"
done

# Output the job summary to a file if PR_NUMBER is set
# Add readable timestamp to the job summary
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
JOB_SUMMARY+="\n*Last updated: $TIMESTAMP UTC*\n"

# Always write to GitHub Actions job summary (visible on workflow run page)
if [ -n "$GITHUB_STEP_SUMMARY" ]; then
echo -e "$JOB_SUMMARY" >> "$GITHUB_STEP_SUMMARY"
fi

# Post PR comment if PR_NUMBER is set (non-fork PRs only)
if [ -n "$PR_NUMBER" ]; then
echo "Writing job summary to check_warp_deploy_summary.txt"

# Add readable timestamp to the job summary
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
JOB_SUMMARY+="\n*Last updated: $TIMESTAMP UTC*\n"

echo -e "$JOB_SUMMARY" > check_warp_deploy_summary.txt

# Use a comment-tag to allow overwriting in subsequent runs
Expand Down