Create RC PR #188
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
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 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: {} | |
jobs: | |
find_release_branches: | |
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' | |
- name: Install python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.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: ${{fromJSON(needs.find_release_branches.outputs.branches)}} | |
steps: | |
- name: Checkout release branch | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
with: | |
ref: ${{ matrix.value }} | |
fetch-depth: 0 | |
- name: Install python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.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 }} | |
run: | | |
echo "CHANGES=$(inv -e release.check-for-changes -r ${{ matrix.value }} ${{ needs.find_release_branches.outputs.warning }})" >> $GITHUB_OUTPUT | |
- name: Create RC PR | |
if: ${{ steps.check_for_changes.outputs.CHANGES == 'true'}} | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git fetch | |
inv -e release.create-rc --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }} |