Skip to content
Open
Show file tree
Hide file tree
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
36 changes: 9 additions & 27 deletions .github/workflows/update-tektoncd-task-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- cron: "0 0 * * *" # Runs daily at midnight
workflow_dispatch: {} # Allows manual trigger

permissions: {}

jobs:
update-task-versions:
runs-on: ubuntu-latest
Expand All @@ -16,51 +18,31 @@ jobs:
- name: Checkout Operator Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Clone TektonCD Catalog (p branch)
run: |
git clone --branch p https://github.com/openshift-pipelines/tektoncd-catalog.git ../tektoncd-catalog

- name: Update Task Versions
id: update
run: |
./hack/openshift/update-openshift-tekton-task-versions.sh \
--catalog-path ../tektoncd-catalog \
--script-path hack/openshift/fetch-tektoncd-catalog-tasks.sh
echo "has_changes=$(git diff --name-only | grep -q fetch-tektoncd-catalog-tasks.sh && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT

- name: Set up Git config
if: steps.update.outputs.has_changes == 'true'
run: |
git config user.name "tekton-robot"
git config user.email "dlorenc+tekton@google.com"

- name: Commit Changes
if: steps.update.outputs.has_changes == 'true'
run: |
git add hack/openshift/fetch-tektoncd-catalog-tasks.sh
if ! git diff --cached --quiet; then
git commit -m "Update Tekton task versions"
else
echo "No changes to commit. Skipping."
fi
run: ./hack/openshift/update-openshift-tekton-task-versions.sh

- name: Create Pull Request
if: steps.update.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.CHATOPS_TOKEN }}
commit-message: "Update Tekton task versions"
committer: Shubham Bhardwaj <shubbhar@redhat.com>
committer: tekton-bot <tekton-bot@users.noreply.github.com>
author: Shubham Bhardwaj <shubbhar@redhat.com>
signoff: true
title: "Update Tekton task versions"
body: |
This PR automatically updates the task versions in the `fetch-tektoncd-catalog-tasks.sh` script.

The versions are pulled from the latest available versions in the [tektoncd-catalog](https://github.com/openshift-pipelines/tektoncd-catalog) repository.
branch: update-tekton-versions
base: main
labels: automation
labels: |
automation
release-note-none
delete-branch: true
5 changes: 1 addition & 4 deletions hack/openshift/update-openshift-tekton-task-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ FETCH_SCRIPT="hack/openshift/fetch-tektoncd-catalog-tasks.sh"

# Check if the tektoncd-catalog repo exists
if [[ ! -d "$TEKTON_CATALOG_DIR" ]]; then
echo "Error: tektoncd-catalog repo is missing! Clone it first."
echo "Error: tektoncd-catalog repo is missing! Clone it first." >&2
exit 1
fi

# Backup the original fetch script before modifying
cp "$FETCH_SCRIPT" "$FETCH_SCRIPT.bak"

# Track if any updates were made
updated=false

Expand Down
Loading