|
17 | 17 | - name: Fetch Celestia App Consts
|
18 | 18 | id: fetch_celestia_consts
|
19 | 19 | run: |
|
20 |
| - curl -sSL https://raw.githubusercontent.com/celestiaorg/celestia-app/main/pkg/appconsts/initial_consts.go -o /tmp/celestia_initial_consts.go |
| 20 | + curl -sSL https://raw.githubusercontent.com/celestiaorg/celestia-app/refs/tags/v5.0.1/pkg/appconsts/app_consts.go -o /tmp/celestia_initial_consts.go |
21 | 21 | if [ $? -ne 0 ]; then
|
22 | 22 | echo "Failed to download Celestia app consts file."
|
23 | 23 | exit 1
|
@@ -60,29 +60,30 @@ jobs:
|
60 | 60 |
|
61 | 61 | # Perform the diff and handle its exit code robustly
|
62 | 62 | diff_command_output=""
|
63 |
| - if ! diff_command_output=$(diff -u "$LOCAL_FILE_TMP" "$CELESTIA_FILE_TMP"); then |
64 |
| - # diff exited with non-zero status |
65 |
| - diff_exit_code=$? |
66 |
| - if [ $diff_exit_code -eq 1 ]; then |
67 |
| - # Exit code 1 means files are different |
68 |
| - echo "Files are different (excluding last line)." |
69 |
| - echo "diff_output<<EOF" >> $GITHUB_OUTPUT |
70 |
| - echo "$diff_command_output" >> $GITHUB_OUTPUT |
71 |
| - echo "EOF" >> $GITHUB_OUTPUT |
72 |
| - echo "files_differ=true" >> $GITHUB_OUTPUT |
73 |
| - exit 1 # Fail the step |
74 |
| - else |
75 |
| - # Exit code > 1 means diff encountered an error |
76 |
| - echo "Error: diff command failed with exit code $diff_exit_code." |
77 |
| - echo "Diff command output/error: $diff_command_output" |
78 |
| - # Output error information for the issue |
79 |
| - echo "diff_output<<EOF" >> $GITHUB_OUTPUT |
80 |
| - echo "Diff command error (exit code $diff_exit_code):" >> $GITHUB_OUTPUT |
81 |
| - echo "$diff_command_output" >> $GITHUB_OUTPUT |
82 |
| - echo "EOF" >> $GITHUB_OUTPUT |
83 |
| - echo "files_differ=true" >> $GITHUB_OUTPUT # Treat as a difference to create an issue |
84 |
| - exit $diff_exit_code |
85 |
| - fi |
| 63 | + diff_exit_code=0 |
| 64 | + diff_command_output=$(diff -u "$LOCAL_FILE_TMP" "$CELESTIA_FILE_TMP") || diff_exit_code=$? |
| 65 | +
|
| 66 | + if [ $diff_exit_code -eq 1 ]; then |
| 67 | + # Exit code 1 means files are different |
| 68 | + echo "Files are different (excluding last line)." |
| 69 | + echo "diff_output<<EOF" >> $GITHUB_OUTPUT |
| 70 | + echo "$diff_command_output" >> $GITHUB_OUTPUT |
| 71 | + echo "EOF" >> $GITHUB_OUTPUT |
| 72 | + echo "files_differ=true" >> $GITHUB_OUTPUT |
| 73 | + echo "::error::Celestia app consts have drifted. Please update da/jsonrpc/internal/consts.go" |
| 74 | + exit 1 # Fail the step |
| 75 | + elif [ $diff_exit_code -gt 1 ]; then |
| 76 | + # Exit code > 1 means diff encountered an error |
| 77 | + echo "Error: diff command failed with exit code $diff_exit_code." |
| 78 | + echo "Diff command output/error: $diff_command_output" |
| 79 | + # Output error information for the issue |
| 80 | + echo "diff_output<<EOF" >> $GITHUB_OUTPUT |
| 81 | + echo "Diff command error (exit code $diff_exit_code):" >> $GITHUB_OUTPUT |
| 82 | + echo "$diff_command_output" >> $GITHUB_OUTPUT |
| 83 | + echo "EOF" >> $GITHUB_OUTPUT |
| 84 | + echo "files_differ=true" >> $GITHUB_OUTPUT # Treat as a difference to create an issue |
| 85 | + echo "::error::Failed to compare files due to diff error" |
| 86 | + exit $diff_exit_code |
86 | 87 | else
|
87 | 88 | # diff exited with 0, files are identical
|
88 | 89 | echo "Files are identical (excluding last line)."
|
|
0 commit comments