Skip to content

Commit 70dc264

Browse files
added section about limitation for branch protections
1 parent 7424c9c commit 70dc264

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@ This project provides a GitHub Action that helps federal agencies maintain their
2828

2929
This approach tries to push directly to the branch using a Personal Access Token, but falls back to creating a pull request if the direct push fails. When users need to edit code.json, they should create a PR which will automatically validate their changes. Refer to this [section](https://github.com/DSACMS/automated-codejson-generator?tab=readme-ov-file#setting-up-personal-access-token-pat) for a guide to create the necessary Personal Access Token.
3030

31+
#### Direct Push Mode Limitations
32+
33+
**Important:** Direct push mode (`SKIP_PR: "true"`) will fall back to creating a pull request if:
34+
- Branch protection rules are enabled on the target branch
35+
- The PAT doesn't have sufficient permissions
36+
- Any other push restriction exists
37+
38+
This is expected behavior. If you need all updates to go through pull requests, use `SKIP_PR: "false"`.
39+
40+
##### When Direct Push Works
41+
- No branch protection on target branch
42+
- PAT has write access
43+
- No other repository restrictions
44+
45+
##### When It Falls Back to PR
46+
- Branch protection enabled (including admin enforcement)
47+
- Required status checks
48+
- Required pull request reviews
49+
- Any push restrictions
50+
51+
**Recommendation:** For repositories with branch protection, use `SKIP_PR: "false"` to always create pull requests.
52+
3153
```yaml
3254
name: Update Code.json
3355
on:

src/helper.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ export async function validateOnly(): Promise<void> {
163163
}
164164

165165
core.info("code.json is valid!");
166-
core.setOutput("validated", true);
167166
} catch (error) {
168167
core.setFailed(`validation error: ${error}`);
169168
}

0 commit comments

Comments
 (0)