sf-plugin-permission-sets 0.0.0-dev.49 → 0.0.0-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,12 +16,12 @@ Stop clicking through Setup to grant access. Commit a YAML file, open a PR, let
|
|
|
16
16
|
- [Why](#why)
|
|
17
17
|
- [Install](#install)
|
|
18
18
|
- [Quick start](#quick-start)
|
|
19
|
-
- [GitHub Actions](#github-actions)
|
|
20
19
|
- [Permission files](#permission-files)
|
|
21
20
|
- [Organizing files](#organizing-files)
|
|
22
21
|
- [Modes](#modes)
|
|
23
22
|
- [Validations](#validations)
|
|
24
23
|
- [Commands](#commands)
|
|
24
|
+
- [GitHub Actions](#github-actions)
|
|
25
25
|
- [Inspiration & equivalents](#inspiration--equivalents)
|
|
26
26
|
- [Versioning](#versioning)
|
|
27
27
|
- [Architecture](#architecture)
|
|
@@ -78,59 +78,6 @@ sf ps apply --file "./permissions/*.yml" --target-org dev
|
|
|
78
78
|
sf ps apply --file "./permissions/*.yml" --target-org prod --mode sync
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
## GitHub Actions
|
|
82
|
-
|
|
83
|
-
Two dead-simple workflows: check every pull request with no org, then apply on merge.
|
|
84
|
-
|
|
85
|
-
**1. Check on every pull request** (no org, no secrets):
|
|
86
|
-
|
|
87
|
-
```yaml
|
|
88
|
-
# .github/workflows/permissions-check.yml
|
|
89
|
-
name: permissions-check
|
|
90
|
-
on: pull_request
|
|
91
|
-
jobs:
|
|
92
|
-
check:
|
|
93
|
-
runs-on: ubuntu-latest
|
|
94
|
-
steps:
|
|
95
|
-
- uses: actions/checkout@v4
|
|
96
|
-
- uses: actions/setup-node@v4
|
|
97
|
-
with:
|
|
98
|
-
node-version: 20
|
|
99
|
-
- run: npm install --global @salesforce/cli
|
|
100
|
-
- run: sf plugins install sf-plugin-permission-sets
|
|
101
|
-
- run: sf ps check --file "permissions/*.yml"
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
**2. Apply on merge to main** (needs org auth):
|
|
105
|
-
|
|
106
|
-
```yaml
|
|
107
|
-
# .github/workflows/permissions-apply.yml
|
|
108
|
-
name: permissions-apply
|
|
109
|
-
on:
|
|
110
|
-
push:
|
|
111
|
-
branches: [main]
|
|
112
|
-
paths: ["permissions/**"]
|
|
113
|
-
jobs:
|
|
114
|
-
apply:
|
|
115
|
-
runs-on: ubuntu-latest
|
|
116
|
-
steps:
|
|
117
|
-
- uses: actions/checkout@v4
|
|
118
|
-
- uses: actions/setup-node@v4
|
|
119
|
-
with:
|
|
120
|
-
node-version: 20
|
|
121
|
-
- run: npm install --global @salesforce/cli
|
|
122
|
-
- run: sf plugins install sf-plugin-permission-sets
|
|
123
|
-
# Authenticate to the org from a stored auth URL.
|
|
124
|
-
- run: echo '${{ secrets.SF_AUTH_URL }}' > auth.txt
|
|
125
|
-
- run: sf org login sfdx-url --sfdx-url-file auth.txt --alias prod
|
|
126
|
-
# --no-prompt so a deletion never blocks on a confirmation in CI.
|
|
127
|
-
- run: sf ps apply --file "permissions/*.yml" --target-org prod --mode sync --no-prompt
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Get the auth URL once with `sf org display --verbose --target-org prod`, copy the `Sfdx Auth Url` value, and save it as a repository secret named `SF_AUTH_URL`.
|
|
131
|
-
|
|
132
|
-
Want the diff on the PR before merging? Add a `sf ps plan --file "permissions/*.yml" --target-org prod` step (it needs the same org auth) to the check workflow.
|
|
133
|
-
|
|
134
81
|
## Permission files
|
|
135
82
|
|
|
136
83
|
`check`, `validate`, `plan`, and `apply` read one or more YAML files with `--file` (alias `-f`). (`export` writes YAML rather than reading it, so there `-f` is the output file.)
|
|
@@ -439,6 +386,61 @@ sf ps export -o prod --output-file team.yml \
|
|
|
439
386
|
|
|
440
387
|
A requested `--user` that has no matching assignments (a typo, or a user who genuinely holds nothing in scope) is reported as a warning and the export continues with whoever matched, so a mistyped username never masquerades as a clean empty file.
|
|
441
388
|
|
|
389
|
+
## GitHub Actions
|
|
390
|
+
|
|
391
|
+
Two dead-simple workflows: check pull requests to main with no org, then apply on merge.
|
|
392
|
+
|
|
393
|
+
**1. Check pull requests to main** (no org, no secrets):
|
|
394
|
+
|
|
395
|
+
```yaml
|
|
396
|
+
# .github/workflows/permissions-check.yml
|
|
397
|
+
name: permissions-check
|
|
398
|
+
on:
|
|
399
|
+
pull_request:
|
|
400
|
+
branches: [main]
|
|
401
|
+
jobs:
|
|
402
|
+
check:
|
|
403
|
+
runs-on: ubuntu-latest
|
|
404
|
+
steps:
|
|
405
|
+
- uses: actions/checkout@v4
|
|
406
|
+
- uses: actions/setup-node@v4
|
|
407
|
+
with:
|
|
408
|
+
node-version: 20
|
|
409
|
+
- run: npm install --global @salesforce/cli
|
|
410
|
+
- run: sf plugins install sf-plugin-permission-sets
|
|
411
|
+
- run: sf ps check --file "permissions/*.yml"
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**2. Apply on merge to main** (needs org auth):
|
|
415
|
+
|
|
416
|
+
```yaml
|
|
417
|
+
# .github/workflows/permissions-apply.yml
|
|
418
|
+
name: permissions-apply
|
|
419
|
+
on:
|
|
420
|
+
push:
|
|
421
|
+
branches: [main]
|
|
422
|
+
paths: ["permissions/**"]
|
|
423
|
+
jobs:
|
|
424
|
+
apply:
|
|
425
|
+
runs-on: ubuntu-latest
|
|
426
|
+
steps:
|
|
427
|
+
- uses: actions/checkout@v4
|
|
428
|
+
- uses: actions/setup-node@v4
|
|
429
|
+
with:
|
|
430
|
+
node-version: 20
|
|
431
|
+
- run: npm install --global @salesforce/cli
|
|
432
|
+
- run: sf plugins install sf-plugin-permission-sets
|
|
433
|
+
# Authenticate to the org from a stored auth URL.
|
|
434
|
+
- run: echo '${{ secrets.SF_AUTH_URL }}' > auth.txt
|
|
435
|
+
- run: sf org login sfdx-url --sfdx-url-file auth.txt --alias prod
|
|
436
|
+
# --no-prompt so a deletion never blocks on a confirmation in CI.
|
|
437
|
+
- run: sf ps apply --file "permissions/*.yml" --target-org prod --mode sync --no-prompt
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
Get the auth URL once with `sf org display --verbose --target-org prod`, copy the `Sfdx Auth Url` value, and save it as a repository secret named `SF_AUTH_URL`.
|
|
441
|
+
|
|
442
|
+
Want the diff on the PR before merging? Add a `sf ps plan --file "permissions/*.yml" --target-org prod` step (it needs the same org auth) to the check workflow.
|
|
443
|
+
|
|
442
444
|
## Inspiration & equivalents
|
|
443
445
|
|
|
444
446
|
This plugin's command surface borrows ideas from tools you already know:
|
package/package.json
CHANGED