Automatically create a datadog-agent PR when merging an omnibus-software PR #19
Workflow file for this run
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: Open datadog-agent PR | |
run-name: | |
on: | |
pull_request: | |
# types: | |
# - closed | |
jobs: | |
open_pr: | |
# if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone datadog-agent repo | |
uses: actions/checkout@v4 | |
env: | |
WIP_AUTO_PR_TOKEN: ${{ secrets.WIP_AUTO_PR }} | |
with: | |
repository: datadog/datadog-agent | |
path: datadog-agent | |
ref: chouquette/add_release_json_setter | |
token: ${WIP_AUTO_PR_TOKEN} | |
- name: Setup Python3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.5" | |
cache: "pip" | |
- name: Install python deps | |
working-directory: datadog-agent | |
run: pip3 install -r requirements.txt | |
- name: Update release.json | |
working-directory: datadog-agent | |
env: | |
OMNIBUS_SHA: ${{ github.event.pull_request.head.sha }} | |
run: | | |
inv -e release.set-release-json 'nightly::OMNIBUS_SOFTWARE_VERSION' ${OMNIBUS_SHA} | |
inv -e release.set-release-json 'nightly-a7::OMNIBUS_SOFTWARE_VERSION' ${OMNIBUS_SHA} | |
- name: create datadog-agent PR | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${WIP_AUTO_PR} | |
base: main | |
delete-branch: true | |
path: datadog-agent | |
add-paths: release.json | |
commit-message: 'omnibus: bump OMNIBUS_SOFTWARE_VERSION' | |
title: '[omnibus][automated] Bump OMNIBUS_SOFTWARE_VERSION' | |
branch: 'automated/omnibus-software/${{ github.event.number }}' |