Skip to content

Update tektoncd-pipeline.yaml #576

Update tektoncd-pipeline.yaml

Update tektoncd-pipeline.yaml #576

---
name: Generate konflux configurations
on:
push:
workflow_dispatch: # Manual workflow trigger
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update-projects:
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Generate configurations and pull-requests
run: |
echo "Let's go"
gh auth status
gh auth setup-git
go run ./cmd/konflux/ config/konflux/openshift-pipelines-core.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-cli.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-operator.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.12.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.13.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.14.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.15.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.16.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.17.yaml
go run ./cmd/konflux/ config/konflux/openshift-pipelines-index-4.18.yaml
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
GITHUB_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
- name: Commit new changes
run: |
BASE_BRANCH=${GITHUB_REF#refs/heads/}
SOURCE_BRANCH=actions/update/hack-update-konflux-${BASE_BRANCH}
git config user.name openshift-pipelines-bot
git config user.email [email protected]
git checkout -b ${SOURCE_BRANCH}
git add -f .konflux
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
echo "No change, exiting"
exit 0
fi
git commit -F- <<EOF
[bot:${BASE_BRANCH}] Update Generated Konflux Config
EOF
git push -f origin ${SOURCE_BRANCH}
if [ "$(gh pr list --base ${BASE_BRANCH} --head ${SOURCE_BRANCH} --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B ${BASE_BRANCH} -H ${SOURCE_BRANCH} --label=automated --fill
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}