@@ -62,21 +62,43 @@ jobs:
62
62
- name : Check node modules up to date
63
63
run : .github/workflows/script/check-node-modules.sh
64
64
65
- verify-pr-checks :
66
- name : Verify PR checks up to date
65
+ check-file-contents :
66
+ name : Check file contents
67
67
runs-on : ubuntu-latest
68
68
timeout-minutes : 45
69
69
70
70
steps :
71
- - uses : actions/checkout@v3
71
+ - name : Checkout
72
+ uses : actions/checkout@v3
73
+
74
+ # Checks for any conflict markers created by git. This check is primarily intended to validate that
75
+ # any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged.
76
+ - name : Check for merge conflicts
77
+ run : |
78
+ # Use `|| true` since grep returns exit code 1 if there are no matches, and we don't want
79
+ # this to fail the workflow.
80
+ FILES_WITH_CONFLICTS=$(grep --extended-regexp --ignore-case --line-number --recursive \
81
+ '^(<<<<<<<|>>>>>>>)' . || true)
82
+ if [[ "${FILES_WITH_CONFLICTS}" ]]; then
83
+ echo "Fail: Found merge conflict markers in the following files:"
84
+ echo ""
85
+ echo "${FILES_WITH_CONFLICTS}"
86
+ exit 1
87
+ else
88
+ echo "Success: Found no merge conflict markers."
89
+ fi
90
+
72
91
- name : Set up Python
73
92
uses : actions/setup-python@v3
74
93
with :
75
94
python-version : 3.8
95
+
76
96
- name : Install dependencies
77
97
run : |
78
98
python -m pip install --upgrade pip
79
99
pip install ruamel.yaml
100
+
101
+ # Ensure the generated PR check workflows are up to date.
80
102
- name : Verify PR checks up to date
81
103
run : .github/workflows/script/verify-pr-checks.sh
82
104
0 commit comments