Skip to content

Bump components.yaml on main branch #1107

Bump components.yaml on main branch

Bump components.yaml on main branch #1107

name: Bump components.yaml on main branch
on: # yamllint disable-line rule:truthy
workflow_dispatch: {}
schedule:
# Run this every week day at 1AM
- cron: '0 1 * * 1-5'
permissions: {}
jobs:
bump-payloads:
name: "Bump payloads"
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.repository_owner == 'tektoncd' # do not run this elsewhere
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: run operator-tool bump
run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
make components/bump 2> bump-output.txt || true
cat bump-output.txt >&2
- name: generate commit message and PR body
id: generate-message
run: |
if [[ -f bump-output.txt ]]; then
./.github/scripts/generate-bump-message.sh bump-output.txt commit-message.txt pr-body.txt
if [[ -f commit-message.txt ]]; then
COMMIT_MSG=$(cat commit-message.txt)
PR_TITLE=$(head -n1 commit-message.txt)
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
echo "${COMMIT_MSG}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "pr_title=${PR_TITLE}" >> $GITHUB_OUTPUT
if [[ -f pr-body.txt ]]; then
echo "pr_body<<EOF" >> $GITHUB_OUTPUT
cat pr-body.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
else
echo "commit_message=chore: bump payload versions" >> $GITHUB_OUTPUT
echo "pr_title=chore: bump payload versions" >> $GITHUB_OUTPUT
echo "pr_body=Automated component version bump" >> $GITHUB_OUTPUT
fi
else
echo "commit_message=chore: bump payload versions" >> $GITHUB_OUTPUT
echo "pr_title=chore: bump payload versions" >> $GITHUB_OUTPUT
echo "pr_body=Automated component version bump" >> $GITHUB_OUTPUT
fi
- name: clean up temporary files
run: |
rm -f bump-output.txt commit-message.txt pr-body.txt
- name: create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ secrets.CHATOPS_TOKEN }}
commit-message: ${{ steps.generate-message.outputs.commit_message }}
committer: tekton-bot <tekton-bot@users.noreply.github.com>
author: Vincent Demeester <vdemeest@redhat.com>
signoff: true
# author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: bot-bump-payload
delete-branch: true
title: ${{ steps.generate-message.outputs.pr_title }}
body: ${{ steps.generate-message.outputs.pr_body }}
labels: |
release-note-none