delete all wip in an evil pr #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Allow Changes in User-Specific shaders/ Directory to Main | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'shaders/*/**' | |
types: [opened, synchronize, reopened] | |
jobs: | |
auto-approve-and-merge: | |
if: github.base_ref == 'main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Check for changes in user-specific directory | |
id: check_changes | |
env: | |
PR_AUTHOR: ${{ github.event.pull_request.user.login }} | |
run: | | |
git fetch origin ${{ github.base_ref }} | |
git diff --name-status origin/main ${{ github.sha }} | grep -E '^\w\s+shaders/'"${PR_AUTHOR}"'/.*' > pr_changes.txt | |
if [ -s pr_changes.txt ]; then | |
echo "Changes detected in the user-specific directory, proceeding with auto-approve and merge." | |
echo "valid_user_directory=true" >> $GITHUB_ENV | |
else | |
echo "No changes in the user-specific directory, not proceeding." | |
echo "valid_user_directory=false" >> $GITHUB_ENV | |
fi | |
- name: Auto approve | |
uses: hmarr/auto-approve-action@v2 | |
if: env.valid_user_directory == 'true' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Merge PR | |
uses: actions/github-script@v5 | |
if: env.valid_user_directory == 'true' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.pulls.merge({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
merge_method: 'squash' | |
}); |