Skip to content

Rename Sorting Codes.cpp to Sorting Functions.cpp #1

Rename Sorting Codes.cpp to Sorting Functions.cpp

Rename Sorting Codes.cpp to Sorting Functions.cpp #1

Workflow file for this run

Pname: Auto Approve and Merge PR

Check failure on line 1 in .github/workflows/PR.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/PR.yml

Invalid workflow file

The workflow is not valid. .github/workflows/PR.yml (Line: 1, Col: 1): Unexpected value 'Pname'
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
auto_approve_merge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Check if all checks have passed
id: checks
run: |
checks=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits" \
| jq -r '.[].commit.checks_url')
check_statuses=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
$checks \
| jq -r '.[].status')
echo "Check statuses: $check_statuses"
if [[ ! "$check_statuses" =~ "failure" ]]; then
echo "All checks passed. Approving and merging PR."
echo "::set-output name=approved::true"
else
echo "Some checks failed. Not approving PR."
echo "::set-output name=approved::false"
fi
- name: Approve and Merge PR
if: steps.checks.outputs.approved == 'true'
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"event": "APPROVE"}' \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews"
curl -X PUT \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"merge_method": "merge"}' \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge"