Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: make the PR from a feature branch to avoid force pushing main branch #158

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/raise-operator-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ jobs:
VERSION_WITHOUT_V="${VERSION#v}"
cp -r /tmp/bundle-operator-move2kube "${VERSION_WITHOUT_V}" && cp /tmp/bundle.Dockerfile "${VERSION_WITHOUT_V}"/bundle.Dockerfile
echo 'make a commit and push to our fork'
# https://stackoverflow.com/questions/67789507/generate-unique-string-in-github-actions
BRANCH_NAME='feat-${{ github.event.inputs.tag }}-${{ github.run_id }}-${{ github.run_attempt }}'
git checkout -b "${BRANCH_NAME}"
git add -A
git commit -s -m 'operator move2kube-operator (${{ github.event.inputs.tag }})'
git push -u origin main
git push -u origin "${BRANCH_NAME}"
- name: create-pull-request-to-community-repo
run: |
curl -L \
Expand All @@ -64,7 +67,7 @@ jobs:
-H 'Authorization: Bearer ${{ secrets.MOVE2KUBE_PATOKEN }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
https://api.github.com/repos/k8s-operatorhub/community-operators/pulls \
-d '{"title":"operator move2kube-operator (${{ github.event.inputs.tag }})","body":"An automated PR to update move2kube-operator to ${{ github.event.inputs.tag }}","head":"move2kube:main","base":"main"}'
-d '{"title":"operator move2kube-operator (${{ github.event.inputs.tag }})","body":"An automated PR to update move2kube-operator to ${{ github.event.inputs.tag }}","head":"move2kube:'"${BRANCH_NAME}"'","base":"main"}'
- name: checkout-the-move2kube-fork-of-the-prod-upstream-repo
shell: bash
run: |
Expand All @@ -83,9 +86,12 @@ jobs:
VERSION_WITHOUT_V="${VERSION#v}"
cp -r /tmp/bundle-operator-move2kube "${VERSION_WITHOUT_V}" && cp /tmp/bundle.Dockerfile "${VERSION_WITHOUT_V}"/bundle.Dockerfile
echo 'make a commit and push to our fork'
# https://stackoverflow.com/questions/67789507/generate-unique-string-in-github-actions
BRANCH_NAME='feat-${{ github.event.inputs.tag }}-${{ github.run_id }}-${{ github.run_attempt }}'
git checkout -b "${BRANCH_NAME}"
git add -A
git commit -s -m 'operator move2kube-operator (${{ github.event.inputs.tag }})'
git push -u origin main
git push -u origin "${BRANCH_NAME}"
- name: create-pull-request-to-prod-repo
run: |
curl -L \
Expand All @@ -94,4 +100,4 @@ jobs:
-H 'Authorization: Bearer ${{ secrets.MOVE2KUBE_PATOKEN }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
https://api.github.com/repos/redhat-openshift-ecosystem/community-operators-prod/pulls \
-d '{"title":"operator move2kube-operator (${{ github.event.inputs.tag }})","body":"An automated PR to update move2kube-operator to ${{ github.event.inputs.tag }}","head":"move2kube:main","base":"main"}'
-d '{"title":"operator move2kube-operator (${{ github.event.inputs.tag }})","body":"An automated PR to update move2kube-operator to ${{ github.event.inputs.tag }}","head":"move2kube:'"${BRANCH_NAME}"'","base":"main"}'
Loading