mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-05-14 15:01:44 +00:00
* ci: replace pull_request_target with two-step workflows (#841) * ci: update PR auto assign workflows Signed-off-by: Andy Lee <andy.lee@suse.com> * ci: update backport label workflow Signed-off-by: Andy Lee <andy.lee@suse.com> * ci: update backport PR via mergify workflow Signed-off-by: Andy Lee <andy.lee@suse.com> * ci: update add PR label workflow Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: file name Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: limit auto-assign-check for target branches Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com> (cherry picked from commit 1a92265d039357ad0c1ae3641c6a9aa32a3ab146) * ci: remove brackets in PR Management Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com> Co-authored-by: Andy Lee <andy.lee@suse.com>
56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
name: "PR Management Request Backport via Mergify"
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows:
|
|
- "PR Management Request Backport via Mergify Collect Data"
|
|
types: [completed]
|
|
|
|
jobs:
|
|
comment-backport:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
permissions:
|
|
actions: read
|
|
pull-requests: write
|
|
steps:
|
|
- name: Download PR data artifact
|
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
|
with:
|
|
name: pr-backport-request-data
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ github.token }}
|
|
|
|
- name: Load PR data
|
|
run: |
|
|
cat pr-backport-request-data.env >> $GITHUB_ENV
|
|
|
|
- name: Post Mergify backport command
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
pr_number="$PR_NUMBER"
|
|
repo="${{ github.repository }}"
|
|
|
|
labels=$(echo "$PR_LABELS" | tr ',' '\n')
|
|
|
|
echo "Labels on PR: $labels"
|
|
|
|
matches=$(echo "$labels" | grep -oE '^require backport/v[0-9]+\.[0-9]+$' || true)
|
|
|
|
if [[ -z "$matches" ]]; then
|
|
echo "No back-port labels found — skipping."
|
|
exit 0
|
|
fi
|
|
|
|
branches=$(echo "$matches" \
|
|
| sed -E 's/^require backport\/v/release-harvester-v/' \
|
|
| sort -u | tr '\n' ' ')
|
|
branches=${branches%% }
|
|
|
|
cmd="@Mergifyio backport $branches"
|
|
echo "Posting Mergify command: $cmd"
|
|
gh pr comment "$pr_number" --repo "$repo" --body "$cmd"
|