update-tektoncd-operator #9802
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: update-tektoncd-operator | |
on: | |
schedule: | |
- cron: "*/30 * * * *" # every 30 minutes | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout the current repo | |
uses: actions/checkout@v4 | |
- name: Clone tektoncd/operator | |
uses: actions/checkout@v4 | |
with: | |
repository: tektoncd/operator | |
path: upstream | |
- name: Commit new changes | |
run: | | |
ls upstream/ | |
git config user.name github-actions | |
git config user.email [email protected] | |
git checkout -b actions/update/tektoncd-operator | |
rm -rf upstream/operator/.git | |
git add upstream | |
git commit -m "[bot] Update tektoncd/operator" | |
git push -f origin actions/update/tektoncd-operator | |
- name: Create pull request | |
run: | | |
if [ "$(gh pr list --base main --head actions/update/tektoncd-operator --json url --jq 'length')" = "0" ]; then | |
echo "creating PR..." | |
gh pr create -B main -H actions/update/tektoncd-operator --title "[bot] Update tektoncd/operator" --body "Auto-generated pull request by GitHub actions" | |
else | |
echo "a PR already exists, skipping..." | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |