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 <[email protected]>
  • Loading branch information
derekbit committed Jan 17, 2025
1 parent 4fc4ff3 commit bac3f6c
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 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,53 @@
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://raw.githubusercontent.com/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 }}"
echo "PR was merged into branch: ${{ github.event.pull_request.base.ref }}"
- uses: actions/checkout@v4
with:
repository: longhorn/longhorn
ref: ${{ github.event.pull_request.base.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.
It was triggered by longhorn/longhorn-manager#${{ github.event.pull_request.number}}.

0 comments on commit bac3f6c

Please sign in to comment.