mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
* ci: add auto PR label workflow and script Signed-off-by: Andy Lee <andy.lee@suse.com> * fix: bug fix prefix Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: update label mapping Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: read commitlint prefix from commitlint.config.js Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: rename to scripts/extract-release-label.mjs Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com> (cherry picked from commit ea5e9aa1f41f875fd4e42c0accbb904bd032f570)
34 lines
940 B
YAML
34 lines
940 B
YAML
name: "[PR Management] Add PR Label"
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, reopened]
|
|
branches:
|
|
- main
|
|
- 'release-harvester-v*'
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
auto-assign-pr-label:
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.base_ref }}
|
|
- name: Setup Nodejs with yarn caching
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: yarn
|
|
- name: Set PR label
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
PR_LABEL=$(node ./scripts/extract-pr-label.js "${{ github.event.pull_request.title }}")
|
|
echo "PR_LABEL = $PR_LABEL"
|
|
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --add-label "$PR_LABEL"
|