sf-plugin-permission-sets 0.0.0-dev.47 → 0.0.0-dev.49

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.
Files changed (2) hide show
  1. package/README.md +54 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -16,6 +16,7 @@ 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)
19
20
  - [Permission files](#permission-files)
20
21
  - [Organizing files](#organizing-files)
21
22
  - [Modes](#modes)
@@ -77,6 +78,59 @@ sf ps apply --file "./permissions/*.yml" --target-org dev
77
78
  sf ps apply --file "./permissions/*.yml" --target-org prod --mode sync
78
79
  ```
79
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
+
80
134
  ## Permission files
81
135
 
82
136
  `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.)
@@ -425,11 +479,8 @@ gh release create v0.2.0 --target main --title v0.2.0 --notes "Add ps export"
425
479
  | dist-tag | Published by | Install |
426
480
  | --- | --- | --- |
427
481
  | `latest` | manual release with a normal tag like `v1.2.0` | `sf plugins install sf-plugin-permission-sets` |
428
- | `next` | manual release with a hyphenated tag like `v1.3.0-beta.1` | `sf plugins install sf-plugin-permission-sets@next` |
429
482
  | `dev` | automatic on every push to `main` | `sf plugins install sf-plugin-permission-sets@dev` |
430
483
 
431
- The `next` tag is selected whenever the version contains a hyphen, not by GitHub's prerelease checkbox.
432
-
433
484
  ## Architecture
434
485
 
435
486
  The plugin is layered so every command reuses the same core. Commands stay thin, services hold the orchestration, core holds the reusable primitives, and a thin adapter layer isolates the Salesforce SDK.
package/package.json CHANGED
@@ -122,5 +122,5 @@
122
122
  "exports": "./lib/index.js",
123
123
  "type": "module",
124
124
  "author": "Isaac Ferreira",
125
- "version": "0.0.0-dev.47"
125
+ "version": "0.0.0-dev.49"
126
126
  }