Skip to content

Commit 002c163

Browse files
authored
Merge branch 'main-enterprise' into fix/correct-typo-in-readme
2 parents d00507e + a21c657 commit 002c163

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

.github/workflows/deploy-k8s.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,35 @@ jobs:
2929
steps:
3030
- name: Checkout repository
3131
uses: actions/checkout@v4
32-
- uses: azure/login@v1
32+
- uses: azure/login@v2
3333
with:
3434
client-id: ${{ secrets.AZURE_CLIENT_ID }}
3535
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3636
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37-
- uses: azure/aks-set-context@v3
37+
- uses: azure/aks-set-context@v4
3838
with:
3939
resource-group: ${{env.AZURE_RESOURCE_GROUP}}
4040
cluster-name: ${{env.AZURE_AKS_CLUSTER}}
4141
id: login
4242
- run: |
4343
kubectl get deployment
4444
- name: app-env
45-
uses: azure/k8s-create-secret@v4
45+
uses: azure/k8s-create-secret@v5
4646
with:
4747
namespace: 'default'
4848
secret-type: 'generic'
4949
arguments: --from-literal=APP_ID=${{ secrets.APP_ID }} --from-literal=PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} --from-literal=WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}
5050
secret-name: app-env
5151
- name: Set imagePullSecret
52-
uses: azure/k8s-create-secret@v4
52+
uses: azure/k8s-create-secret@v5
5353
with:
5454
namespace: ${{env.AZURE_AKS_NAMESPACE}}
5555
container-registry-url: ${{env.IMAGE_REGISTRY_URL}}
5656
container-registry-username: ${{ secrets.DOCKER_USERNAME }}
5757
container-registry-password: ${{ secrets.DOCKER_PASSWORD }}
5858
secret-name: 'image-pull-secret'
5959
id: create-secret
60-
- uses: Azure/k8s-deploy@v4.10
60+
- uses: Azure/k8s-deploy@v5
6161
with:
6262
namespace: ${{env.AZURE_AKS_NAMESPACE}}
6363
manifests: |

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,21 @@ The following can be configured:
290290
- `Rulesets`
291291
- `Environments` - wait timer, required reviewers, prevent self review, protected branches deployment branch policy, custom deployment branch policy, variables, deployment protection rules
292292

293-
It is possible to provide an `include` or `exclude` settings to restrict the `collaborators`, `teams`, `labels` to a list of repos or exclude a set of repos for a collaborator.
293+
> [!important]
294+
> It is possible to provide an `include` or `exclude` settings to restrict the `collaborators`, `teams`, `labels` to a list of repos or exclude a set of repos for a collaborator.
295+
> The include/exclude pattern can also be for glob. For e.g.:
296+
```
297+
teams:
298+
- name: Myteam-admins
299+
permission: admin
300+
- name: Myteam-developers
301+
permission: push
302+
- name: Other-team
303+
permission: push
304+
include:
305+
- '*-config'
306+
```
307+
> Will only add `Other-team` to only `*-config` repos
294308
295309
See [`docs/sample-settings/settings.yml`](docs/sample-settings/settings.yml) for a sample settings file.
296310

lib/plugins/diffable.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
const ErrorStash = require('./errorStash')
2323
const MergeDeep = require('../mergeDeep')
2424
const NopCommand = require('../nopcommand')
25+
const Glob = require('../glob')
2526
const ignorableFields = ['id', 'node_id', 'default', 'url']
2627
module.exports = class Diffable extends ErrorStash {
2728
constructor (nop, github, repo, entries, log, errors) {
@@ -39,7 +40,10 @@ module.exports = class Diffable extends ErrorStash {
3940
// this.log.debug(` entries ${JSON.stringify(filteredEntries)}`)
4041
filteredEntries = filteredEntries.filter(attrs => {
4142
if (Array.isArray(attrs.exclude)) {
42-
if (!attrs.exclude.includes(this.repo.repo)) {
43+
const excludeGlobs = attrs.exclude.map(exc => new Glob(exc));
44+
const excludeGlobsMatch = excludeGlobs.some(glob => !!this.repo.repo.match(glob));
45+
46+
if (!attrs.exclude.includes(this.repo.repo) && !excludeGlobsMatch) {
4347
// this.log.debug(`returning not excluded entry = ${JSON.stringify(attrs)} for repo ${this.repo.repo}`)
4448
return true
4549
} else {
@@ -53,7 +57,10 @@ module.exports = class Diffable extends ErrorStash {
5357
})
5458
filteredEntries = filteredEntries.filter(attrs => {
5559
if (Array.isArray(attrs.include)) {
56-
if (attrs.include.includes(this.repo.repo)) {
60+
const includeGlobs = attrs.include.map(inc => new Glob(inc));
61+
const includeGlobsMatch = includeGlobs.some(glob => !!this.repo.repo.match(glob));
62+
63+
if (attrs.include.includes(this.repo.repo) || includeGlobsMatch) {
5764
// this.log.debug(`returning included entry = ${JSON.stringify(attrs)} for repo ${this.repo.repo}`)
5865
return true
5966
} else {

0 commit comments

Comments
 (0)