0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00
logto/.github/workflows/add-labels.yml
Workflow config file is invalid. Please check your config file: yaml: line 13: could not find expected ':'
Gao Sun 1352cce911
test(core): add unit tests for database utils (#95)
* test(core): add unit tests for database utils

* test(core): add tests for `conditionalSql()`
2021-08-28 21:48:06 +08:00

42 lines
1.3 KiB
YAML

name: Add Labels
on:
issues:
types: [opened, edited, reopened]
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
add_labels:
runs-on: ubuntu-latest
steps:
<<<<<<< HEAD
- uses: logto-io/actions-add-labels-run-steps@v1.0.1
=======
- uses: actions/checkout@v2
- name: Extract Label
id: extract-label
run: |
echo "::set-output name=labels_to_add::$(
node -e "
const title = process.env.TITLE;
const labelMapping = {
chore: 'chore',
feat: 'feature',
fix: 'bugfix',
refactor: 'enhancement',
test: 'testing',
};
const foundKey = Object.keys(labelMapping).find((label) => title && title.startsWith(label));
console.log(foundKey ? labelMapping[foundKey] : '');
"
)"
env:
TITLE: ${{ github.event.pull_request.title || github.event.issue.title }}
- uses: actions-ecosystem/action-add-labels@v1.1.0
>>>>>>> 5dc8d4c (test(core): add unit tests for database utils)
with:
title: ${{ github.event.pull_request.title || github.event.issue.title }}
github-token: ${{ github.token }}