-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a59fcd0
commit 82e6693
Showing
1 changed file
with
21 additions
and
37 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,49 +15,33 @@ env: | |
permissions: {} | ||
|
||
jobs: | ||
agent6_check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
a6_error: ${{ steps.a6_error.outputs.value }} | ||
steps: | ||
- name: Check if agent 6 rc PR already exists | ||
id: a6_error | ||
if: ${{ env.IS_AGENT6_RELEASE == 'true' }} | ||
run: | | ||
prs=$(gh pr list \ | ||
--repo "$GITHUB_REPOSITORY" \ | ||
--base "$AGENT6_RELEASE_BRANCH" \ | ||
--json url,title \ | ||
--search "Update release.json and Go modules for in:title") | ||
echo $prs | ||
if [ "$(echo "$prs" | jq 'length')" -gt 0 ]; then | ||
pr_url=$(echo "$prs" | jq -r '.[0].url') | ||
echo "value=Error: An agent 6 release candidate PR already exists, please merge and build it before creating a new one $pr_url" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Send Agent 6 error to slack | ||
uses: slackapi/[email protected] | ||
if: ${{ env.IS_AGENT6_RELEASE == 'true' && steps.a6_error.outputs.value }} | ||
with: | ||
webhook: ${{ secrets.SLACK_DATADOG_AGENT_CI_WEBHOOK }} | ||
webhook-type: webhook-trigger | ||
payload: | | ||
channel_id: "C085P12CTFX" | ||
message: "${{ steps.a6_error.outputs.value }}" | ||
- name: Fail and exit workflow | ||
if: ${{ env.IS_AGENT6_RELEASE == 'true' && steps.a6_error.outputs.value }} | ||
run: | | ||
echo ${{ steps.a6_error.outputs.value }} | ||
exit 1 | ||
find_release_branches: | ||
runs-on: ubuntu-latest | ||
needs: agent6_check | ||
outputs: | ||
branches: ${{ steps.branches.outputs.value }} | ||
warning: ${{ steps.warning.outputs.value }} | ||
steps: | ||
- name: Check if agent 6 rc PR already exists | ||
id: a6_error | ||
if: ${{ env.IS_AGENT6_RELEASE == 'true' }} | ||
run: | | ||
prs=$(gh pr list \ | ||
--repo "$GITHUB_REPOSITORY" \ | ||
--base "$AGENT6_RELEASE_BRANCH" \ | ||
--json url,title \ | ||
--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': 'C085P12CTFX', 'message': '$error_message' }" \ | ||
${{ secrets.SLACK_DATADOG_AGENT_CI_WEBHOOK }} | ||
fi | ||
echo -e "$error_message" | ||
exit 1 | ||
- name: Checkout repository | ||
if: ${{ env.IS_AGENT6_RELEASE == 'false' }} | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
|