Skip to content

Commit

Permalink
Ensure agent 6 RC creation fails if a previous RC PR already exists (#…
Browse files Browse the repository at this point in the history
…32712)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
sabrina-datadog and github-actions[bot] authored Jan 7, 2025
1 parent 84f907c commit e7e0c88
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/create_rc_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ jobs:
branches: ${{ steps.branches.outputs.value }}
warning: ${{ steps.warning.outputs.value }}
steps:
- name: Check if agent 6 rc PR already exists
if: ${{ env.IS_AGENT6_RELEASE == 'true' }}
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--base "$AGENT6_RELEASE_BRANCH" \
--json url,title \
--draft=false \
--search "Update release.json and Go modules for in:title")
if [ "$(echo "$prs" | jq 'length')" -gt 0 ]; then
pr_list=$(echo "$prs" | jq -r '.[] | "- \(.title): \(.url)"')
error_message="AGENT 6 ERROR: The following Agent 6 release candidate PRs already exist. Please address these PRs before creating a new release candidate:\n$pr_list"
curl -X POST -H 'Content-Type: application/json' \
--data "{ 'channel_id': 'C0701E5KYSX', 'message': '$error_message' }" \
${{ secrets.SLACK_DATADOG_AGENT_CI_WEBHOOK }}
echo -e "\n$error_message"
exit 1
fi
- name: Checkout repository

uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
Expand Down

0 comments on commit e7e0c88

Please sign in to comment.