mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-04 03:35:09 -04:00
## Describe your changes Extend CI tag list with Android and iOS ## Issue ticket number and link <!-- Required for anything that changes behavior. Link the issue (or the validated discussion it came from) that the NetBird team already agreed on. See https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#ticket-first-pr-second --> ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] I ran and tested this change locally — I did not rely on CI to find out whether it works - [ ] This PR has a single purpose (not a fix + refactor + feature in one) - [ ] This change is a trivial fix, **OR** it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#ticket-first-pr-second). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated pull request title validation to accept `android` and `ios` tags. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: PR Title Check
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, edited, synchronize, reopened]
|
|
|
|
jobs:
|
|
check-title:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Validate PR title prefix
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const title = context.payload.pull_request.title;
|
|
const allowedTags = [
|
|
'management',
|
|
'client',
|
|
'android',
|
|
'ios',
|
|
'signal',
|
|
'proxy',
|
|
'relay',
|
|
'misc',
|
|
'infrastructure',
|
|
'self-hosted',
|
|
'doc',
|
|
];
|
|
|
|
const pattern = /^\[([^\]]+)\]\s+.+/;
|
|
const match = title.match(pattern);
|
|
|
|
if (!match) {
|
|
core.setFailed(
|
|
`PR title must start with a tag in brackets.\n` +
|
|
`Example: [client] fix something\n` +
|
|
`Allowed tags: ${allowedTags.join(', ')}`
|
|
);
|
|
return;
|
|
}
|
|
|
|
const tags = match[1].split(',').map(t => t.trim().toLowerCase());
|
|
|
|
const invalid = tags.filter(t => !allowedTags.includes(t));
|
|
if (invalid.length > 0) {
|
|
core.setFailed(
|
|
`Invalid tag(s): ${invalid.join(', ')}\n` +
|
|
`Allowed tags: ${allowedTags.join(', ')}`
|
|
);
|
|
return;
|
|
}
|
|
|
|
console.log(`Valid PR title tags: [${tags.join(', ')}]`);
|