new GH action to generate community operator PRs (#572)

* new GH action to generate community PRs;
seems default ubuntu runner already has hub installed, so don't need to explicitly install it

Change-Id: I928ff2c9e3d3010926077841af43ecac40ce3f07
Signed-off-by: nickboldt <nboldt@redhat.com>

* switch trigger to be when master branch PR is merged

Change-Id: I5e36b092f5e702ad36bac783d41b717cd0de6b44
Signed-off-by: nickboldt <nboldt@redhat.com>
pull/571/head
Nick Boldt 2020-12-11 02:31:27 -05:00 committed by GitHub
parent ed3df35359
commit 9eee2bfc6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,42 @@
# This Workflow creates PRs for the release of the latest che-operator to the community operators in OperatorHub
name: Release community operator PRs
on:
# workflow_dispatch:
# inputs:
# forceflag:
# description: 'To update an existing PR, use -f or --force flag here'
# default: ''
# trigger on commit to master branch of new CSVs, eg.,
# https://github.com/eclipse/che-operator/pull/571/files
push:
branches:
- master
paths:
- 'olm/eclipse-che-preview-*/deploy/olm-catalog/eclipse-che-preview-*/eclipse-che-preview-*.package.yaml'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install yq
run: |
python -m pip install --upgrade pip
pip install yq
# - name: Install homebrew and hub
# run: |
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; brew install hub
- name: Release community operator PRs
run: |
hub version
git config --global user.name "Mykhailo Kuznietsov"
git config --global user.email "mkuznets@redhat.com"
export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }}
./olm/prepare-community-operators-update.sh ${{ github.event.inputs.forceflag }}

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
with:
fetch-depth: 0
- name: Set up Python 3.6
uses: actions/setup-python@v2
@ -36,6 +36,7 @@ jobs:
echo "CHE_VERSION=${CHE_VERSION}"
BRANCH=${CHE_VERSION%.*}.x
echo "BRANCH=${BRANCH}"
hub version
git config --global user.name "Mykhailo Kuznietsov"
git config --global user.email "mkuznets@redhat.com"
export GITHUB_TOKEN=${{ secrets.CHE_BOT_GITHUB_TOKEN }}
@ -80,4 +81,4 @@ jobs:
# perform extra checkouts to ensure branches exist locally
git checkout ${BRANCH}
git checkout ${CHE_VERSION}-release
./make-release.sh ${CHE_VERSION} --push-git-changes --pull-requests
./make-release.sh ${CHE_VERSION} --push-git-changes --pull-requests