Skip to content

Commit b6580a0

Browse files
committed
update ci
1 parent 471cc77 commit b6580a0

File tree

6 files changed

+46
-758
lines changed

6 files changed

+46
-758
lines changed

.github/workflows/array-stack-check.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ on:
1010
pull_request_target:
1111
types: [closed]
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
check:
1518
runs-on: ubuntu-latest
1619
if: github.event_name == 'pull_request'
20+
permissions:
21+
pull-requests: read
22+
issues: read
1723
steps:
1824
- name: Check stack dependencies
1925
uses: actions/github-script@v7
@@ -82,6 +88,9 @@ jobs:
8288
github.event_name == 'pull_request_target' &&
8389
github.event.action == 'closed' &&
8490
github.event.pull_request.merged == true
91+
permissions:
92+
pull-requests: write
93+
issues: read
8594
steps:
8695
- name: Trigger recheck of dependent PRs
8796
uses: actions/github-script@v7

apps/cli/README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,18 @@ arr help --all # show all commands
3737
## Workflow
3838

3939
```
40-
# start work
41-
arr create "add user model"
42-
# edit files - jj tracks automatically
43-
arr create "add user API"
44-
# edit more
45-
arr create "add user tests"
46-
47-
# push all 3 as chained PRs
48-
arr submit
49-
50-
# after reviews, sync with trunk
51-
arr sync
52-
53-
# navigate your stack
54-
arr up # go to child
55-
arr down # go to parent
56-
arr log # see where you are
40+
echo "hello" > hello.txt # no need to stage, jj tracks automatically
41+
arr create "add hello" # save as a change
42+
43+
echo "world" > world.txt
44+
arr create "add world" # save as another change
45+
46+
arr submit # push all as stacked PRs
47+
48+
arr sync # after reviews, sync with trunk
5749
```
5850

59-
Each change becomes a PR. PRs are chained so reviewers see the dependency.
51+
Each change becomes a PR. PRs are stacked so reviewers see the dependency.
6052

6153
## CI
6254

apps/cli/src/commands/ci.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
checkRulesetExists,
3-
ciWorkflowExists,
43
enableStackCheckProtection,
54
getBranchProtectionUrl,
65
getRepoInfoFromRemote,
@@ -14,16 +13,16 @@ import { confirm } from "../utils/prompt";
1413
export async function ci(): Promise<void> {
1514
const cwd = process.cwd();
1615

17-
// Create workflow file if not exists
18-
if (ciWorkflowExists(cwd)) {
19-
console.log(dim("Stack check workflow already exists"));
20-
} else {
21-
const result = setupCI(cwd);
22-
if (result.created) {
23-
console.log(
24-
formatSuccess("Created .github/workflows/array-stack-check.yml"),
25-
);
26-
}
16+
// Always write workflow file (create or update)
17+
const result = setupCI(cwd);
18+
if (result.created) {
19+
console.log(
20+
formatSuccess("Created .github/workflows/array-stack-check.yml"),
21+
);
22+
} else if (result.updated) {
23+
console.log(
24+
formatSuccess("Updated .github/workflows/array-stack-check.yml"),
25+
);
2726
}
2827

2928
const repoInfo = await getRepoInfo(cwd);

0 commit comments

Comments
 (0)