Skip to content

Create RC PR

Create RC PR #284

Workflow file for this run

name: Create RC PR
on:
workflow_dispatch:
schedule:
- cron: '0 14 * * 1,3,5' # Run on Monday, Wednesday, and Friday at 14:00 UTC
- cron: '0 8 * * 1,3,5' # Same as above but at 08:00 UTC, to warn agent-integrations team about releasing
- cron: '0 9 * * 1' # Run Agent 6 workflow on Monday at 09:00 UTC
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AGENT6_MATRIX: ${{ ['6.53.x'] }}

Check failure on line 12 in .github/workflows/create_rc_pr.yml

View workflow run for this annotation

GitHub Actions / Create RC PR

Invalid workflow file

The workflow is not valid. .github/workflows/create_rc_pr.yml (Line: 12, Col: 18): Unexpected symbol: '['. Located at position 1 within expression: ['6.53.x'] .github/workflows/create_rc_pr.yml (Line: 19, Col: 13): Unrecognized named-value: 'env'. Located at position 1 within expression: env.IS_AGENT6_RELEASE == 'false'
# IS_AGENT6_RELEASE: ${{ github.event.schedule == '0 9 * * 1' }}
IS_AGENT6_RELEASE: 'true'
permissions: {}
jobs:
find_release_branches:
if: ${{ env.IS_AGENT6_RELEASE == 'false' }}
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.branches.outputs.value }}
warning: ${{ steps.warning.outputs.value }}
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
sparse-checkout: 'tasks'
persist-credentials: false
- name: Install python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.11
cache: "pip"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tasks/libs/requirements-github.txt
pip install -r tasks/requirements_release_tasks.txt
- name: Determine the release active branches
id: branches
run: |
echo "value=$(inv release.get-unreleased-release-branches)" >> $GITHUB_OUTPUT
- name: Set the warning option
id: warning
if: github.event.schedule == '0 8 * * 1,3,5'
run: |
echo "value=-w" >> $GITHUB_OUTPUT
create_rc_pr:
runs-on: ubuntu-latest
needs: find_release_branches
permissions:
contents: write
pull-requests: write
strategy:
matrix:
value: ${{ env.IS_AGENT6_RELEASE == 'true' && fromJSON(env.AGENT6_MATRIX) || fromJSON(needs.find_release_branches.outputs.branches) }}
fail-fast: false
steps:
- name: Checkout the main branch
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
persist-credentials: true
- name: Install python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: 3.11
cache: "pip"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tasks/libs/requirements-github.txt
pip install -r tasks/requirements_release_tasks.txt
- name: Check for changes since last RC
id: check_for_changes
env:
ATLASSIAN_USERNAME: ${{ secrets.ATLASSIAN_USERNAME }}
ATLASSIAN_PASSWORD: ${{ secrets.ATLASSIAN_PASSWORD }}
SLACK_API_TOKEN : ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }}
MATRIX: ${{ matrix.value }}
WARNING: ${{ needs.find_release_branches.outputs.warning }}
run: |
if [ -n "${{ needs.find_release_branches.outputs.warning }}" ]; then
echo "CHANGES=$(inv -e release.check-for-changes -r "$MATRIX" "$WARNING")" >> $GITHUB_OUTPUT
else
echo "CHANGES=$(inv -e release.check-for-changes -r "$MATRIX")" >> $GITHUB_OUTPUT
fi
- name: Create RC PR
if: ${{ steps.check_for_changes.outputs.CHANGES == 'true' || env.IS_AGENT6_RELEASE == 'true' }}
env:
MATRIX: ${{ matrix.value }}
run: |
if ${{ env.IS_AGENT6_RELEASE == 'true' }}; then
inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }} --patch-version
else
inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }}
fi