Merge pull request #1161 from github/adityasharad/actions/combined-check-file-contents
CI: Combine verify-pr-checks and check-for-conflicts jobs
This commit is contained in:
commit
19d025e17f
2 changed files with 25 additions and 34 deletions
31
.github/workflows/check-for-conflicts.yml
vendored
31
.github/workflows/check-for-conflicts.yml
vendored
|
|
@ -1,31 +0,0 @@
|
||||||
# Checks for any conflict markers created by git. This check is primarily intended to validate that
|
|
||||||
# any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged.
|
|
||||||
name: Check for conflicts
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [main, releases/v1, releases/v2]
|
|
||||||
# Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened
|
|
||||||
# by other workflows.
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-for-conflicts:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Check for conflicts
|
|
||||||
run: |
|
|
||||||
# Use `|| true` since grep returns exit code 1 if there are no matches, and we don't want
|
|
||||||
# this to fail the workflow.
|
|
||||||
FILES_WITH_CONFLICTS=$(grep --extended-regexp --ignore-case --line-number --recursive \
|
|
||||||
'^(<<<<<<<|>>>>>>>)' . || true)
|
|
||||||
if [[ "${FILES_WITH_CONFLICTS}" ]]; then
|
|
||||||
echo "Fail: Found merge conflict markers in the following files:"
|
|
||||||
echo ""
|
|
||||||
echo "${FILES_WITH_CONFLICTS}"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "Success: Found no merge conflict markers."
|
|
||||||
fi
|
|
||||||
28
.github/workflows/pr-checks.yml
vendored
28
.github/workflows/pr-checks.yml
vendored
|
|
@ -62,21 +62,43 @@ jobs:
|
||||||
- name: Check node modules up to date
|
- name: Check node modules up to date
|
||||||
run: .github/workflows/script/check-node-modules.sh
|
run: .github/workflows/script/check-node-modules.sh
|
||||||
|
|
||||||
verify-pr-checks:
|
check-file-contents:
|
||||||
name: Verify PR checks up to date
|
name: Check file contents
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Checks for any conflict markers created by git. This check is primarily intended to validate that
|
||||||
|
# any merge conflicts in the v2 -> v1 backport PR are fixed before the PR is merged.
|
||||||
|
- name: Check for merge conflicts
|
||||||
|
run: |
|
||||||
|
# Use `|| true` since grep returns exit code 1 if there are no matches, and we don't want
|
||||||
|
# this to fail the workflow.
|
||||||
|
FILES_WITH_CONFLICTS=$(grep --extended-regexp --ignore-case --line-number --recursive \
|
||||||
|
'^(<<<<<<<|>>>>>>>)' . || true)
|
||||||
|
if [[ "${FILES_WITH_CONFLICTS}" ]]; then
|
||||||
|
echo "Fail: Found merge conflict markers in the following files:"
|
||||||
|
echo ""
|
||||||
|
echo "${FILES_WITH_CONFLICTS}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Success: Found no merge conflict markers."
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
with:
|
with:
|
||||||
python-version: 3.8
|
python-version: 3.8
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install ruamel.yaml
|
pip install ruamel.yaml
|
||||||
|
|
||||||
|
# Ensure the generated PR check workflows are up to date.
|
||||||
- name: Verify PR checks up to date
|
- name: Verify PR checks up to date
|
||||||
run: .github/workflows/script/verify-pr-checks.sh
|
run: .github/workflows/script/verify-pr-checks.sh
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue