diff --git a/.github/workflows/release-community-pr.yml b/.github/workflows/release-community-pr.yml index 51139bf0f..e3e365f20 100644 --- a/.github/workflows/release-community-pr.yml +++ b/.github/workflows/release-community-pr.yml @@ -1,7 +1,48 @@ name: openshift community pull requests on: [push] jobs: - Fork-Sync-Repo: + create-community-pr: runs-on: ubuntu-latest steps: - - run: gh help + - name: sync fork + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh repo sync DataDog/community-operators \ + --source k8s-operatorhub/community-operators \ + --force + + - name: checkout fork + uses: actions/checkout@v4 + with: + repository: DataDog/community-operators + token: ${{ secrets.GITHUB_TOKEN }} + + - name: checkout datadog-operator to tmp/ dir + uses: actions/checkout@v4 + with: + repository: Datadog/datadog-operator + token: ${{ secrets.GITHUB_TOKEN }} + path: tmp/ + + - name: update bundle + run: | + mkdir operators/datadog-operator/test-version + cp -R ./tmp/bundle/* operators/opentelemetry-operator/test-version + + - name: create PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + message="test PR" + body="test PR" + branch="community-prs" + git checkout -b $branch + git add -A + git commit -s -m "$message" + git push -f --set-upstream origin $branch + gh pr create --title "$message" \ + --body "$body" \ + --repo DataDog/community-operators + --base main + --draft