Skip to content

Commit

Permalink
fixup! ci: automate the process of making a PR to Operator Hub repos
Browse files Browse the repository at this point in the history
Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
  • Loading branch information
HarikrishnanBalagopal committed Aug 26, 2023
1 parent c4573fa commit 8466327
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/raise-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ on:
description: "current tag: The tag for this release"
required: true
default: v0.1.0-rc.2
prev_tag:
description: "previous tag: Tag from which to start calculating the changelog"
required: true
default: v0.1.0-beta.0
commit_ref:
description: "commit ref: The branch or tag of the commit to use for the release. The same tag needs to exist in the UI repo for copying the Helm chart."
description: "commit ref: The branch or tag of the commit to use for the release."
required: false
default: main

Expand All @@ -33,22 +29,21 @@ jobs:
- name: cleanup
run: rm -rf {*,.*} || true
- name: checkout-the-move2kube-fork-of-upstream-repo
uses: actions/checkout@v2
with:
repository: 'move2kube/community-operators'
# TODO: should we only support main branch? release-0.x branches may not exist. Might require separate channels
ref: ${{ github.event.inputs.commit_ref }}
run: |
git clone 'https://move2kube:${{ secrets.MOVE2KUBE_PATOKEN }}@github.com/move2kube/community-operators'
git checkout main
git config user.name move2kube
git config user.email move2kube@gmail.com
- name: copy-bundle-into-fork-creating-new-version-dir
run: |
cd operators/move2kube-operator/ || exit 1
cp -r /tmp/bundle-operator-move2kube '${{ github.event.inputs.tag }}' && cp /tmp/bundle.Dockerfile '${{ github.event.inputs.tag }}/bundle.Dockerfile'
- name: make a commit
# TODO: same as above, expecting commit_ref to be main branch
run: |
# login to the repo
git add --all
git add -A
git commit -s -m "operator move2kube-operator (${{ github.event.inputs.tag }})"
git push --set-upstream origin ${{ github.event.inputs.commit_ref }}
- name: create-pull-request
run: |
curl "https://api.github.com/repos/k8s-operatorhub/community-operators/pulls" --user "${GITHUB_USER}:${GITHUB_TOKEN}" -X POST --data '{"title": "'"$(git log -1 --format=%s)"'", "base": "main", "body": "An automated PR to update konveyor-operator to v'"${OPERATOR_VERSION}"'", "head": "'"${GITHUB_USER}:${OPERATOR_VERSION}"'"}'
git push -u origin main
# - name: create-pull-request
# run: |
# curl "https://api.github.com/repos/k8s-operatorhub/community-operators/pulls" --user "${GITHUB_USER}:${GITHUB_TOKEN}" -X POST --data '{"title": "'"$(git log -1 --format=%s)"'", "base": "main", "body": "An automated PR to update konveyor-operator to v'"${OPERATOR_VERSION}"'", "head": "'"${GITHUB_USER}:${OPERATOR_VERSION}"'"}'

0 comments on commit 8466327

Please sign in to comment.