Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-approve: Do not fail job if not able to merge #51

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,26 @@ jobs:
uses: tj-actions/changed-files@v40

- name: Check non critical
id: non-critical
run: |
ACCEPTED_PATHS="^bin/|^design-docs/"
CRITICAL=false
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file"
# exit as soon as a file does not match the ACCEPTED_PATHS
[[ "$file" =~ ${ACCEPTED_PATHS} ]] || exit 1
# set CRITICAL as true when a file does not match the ACCEPTED_PATHS
[[ "$file" =~ ${ACCEPTED_PATHS} ]] || CRITICAL=true
done
echo "critical=${CRITICAL}" >> "$GITHUB_OUTPUT"

- name: Approve pull request
if: ${{ steps.non-critical.outputs.critical == 'false' }}
uses: hmarr/auto-approve-action@v3
with:
review-message: "Auto approved since only non critical files were changed"


- name: Merge to master
if: ${{ steps.non-critical.outputs.critical == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: ""
Expand Down
Loading