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

Do not create a new issue on cargo-generate merge conflicts if one already exists #277

Merged
merged 3 commits into from
Aug 16, 2024
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
14 changes: 14 additions & 0 deletions .github/workflows/cargo-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ jobs:
# This is required to use the `gh` CLI.
GH_TOKEN: ${{ github.token }}
run: |
# Get a list of the IDs of open issues created by this action, then count them using JQ.
OPEN_ISSUES="$(
gh issue list \
--search "is:issue is:open author:app/github-actions in:title ${TITLE}" \
--json id \
--jq '. | length'
)"
# If an issue already exists, do not create another.
if [[ "${OPEN_ISSUES}" -gt 0 ]]; then
echo 'An issue already exists on merge conflicts! Exiting without creating another.'
exit 0
fi
GIT_STATUS="$(git status)"
# Filter the diff to only include files with merge conflicts.
Expand Down