Skip to content

Commit bf8b6d1

Browse files
changed readme ordering
1 parent 92c654c commit bf8b6d1

1 file changed

Lines changed: 42 additions & 42 deletions

File tree

README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,21 @@ A GitHub Action that automatically generates and maintains code.json files for f
66

77
This project provides a GitHub Action that helps federal agencies maintain their code.json files, which are required for compliance with the Federal Source Code Policy. The action automatically calculates and updates various metadata fields including labor hours, programming languages used, repository information, and timestamps. It can either create pull requests or push directly to branches (with appropriate permissions), making it easier to keep code.json files accurate and up-to-date.
88

9-
## Inputs
9+
## How It Works
1010

11-
```yaml
12-
GITHUB_TOKEN:
13-
description: "GitHub token used for API access and PR creation"
14-
required: true
15-
default: ${{ github.token }}
16-
17-
BRANCH:
18-
description: "Name of the branch to update"
19-
required: false
20-
21-
SKIP_PR:
22-
description: "Try to push directly to branch first, fallback to PR if it fails. Requires ADMIN_TOKEN."
23-
required: false
24-
default: "false"
25-
26-
ADMIN_TOKEN:
27-
description: "Personal Access Token with admin/write privileges for direct push. Required when SKIP_PR is true."
28-
required: false
29-
```
30-
31-
## Outputs
11+
**Automatic Generation**
3212

33-
```yaml
34-
updated:
35-
description: "Boolean indicating whether code.json was updated"
13+
- The action calculates metadata, validates it, and creates a PR or pushes directly
14+
- Validation ensures only valid code.json is created
15+
- Users can then fill in manual fields by editing the PR
3616

37-
pr_url:
38-
description: "URL of the created pull request if changes were made via PR"
17+
**PR Validation**
3918

40-
commit_sha:
41-
description: "SHA of the commit if pushed directly to branch"
19+
- When users edit code.json in a PR, validation runs automatically on every commit
20+
- The PR cannot be merged if validation fails (when branch protection is enabled)
21+
- Error messages help users fix issues quickly
4222

43-
method_used:
44-
description: "Method used for the update: 'direct_push' or 'pull_request'"
45-
```
23+
**Important:** For direct push mode, users should always create PRs when manually editing code.json to ensure validation runs. Direct edits to the main branch will not be validated by this action.
4624

4725
## Workflow Examples
4826

@@ -131,21 +109,43 @@ jobs:
131109
SKIP_PR: "false"
132110
```
133111
134-
### How It Works
112+
### Inputs
135113
136-
**Automatic Generation**
114+
```yaml
115+
GITHUB_TOKEN:
116+
description: "GitHub token used for API access and PR creation"
117+
required: true
118+
default: ${{ github.token }}
137119

138-
- The action calculates metadata, validates it, and creates a PR or pushes directly
139-
- Validation ensures only valid code.json is created
140-
- Users can then fill in manual fields by editing the PR
120+
BRANCH:
121+
description: "Name of the branch to update"
122+
required: false
141123

142-
**PR Validation**
124+
SKIP_PR:
125+
description: "Try to push directly to branch first, fallback to PR if it fails. Requires ADMIN_TOKEN."
126+
required: false
127+
default: "false"
143128

144-
- When users edit code.json in a PR, validation runs automatically on every commit
145-
- The PR cannot be merged if validation fails (when branch protection is enabled)
146-
- Error messages help users fix issues quickly
129+
ADMIN_TOKEN:
130+
description: "Personal Access Token with admin/write privileges for direct push. Required when SKIP_PR is true."
131+
required: false
132+
```
147133
148-
**Important:** For direct push mode, users should always create PRs when manually editing code.json to ensure validation runs. Direct edits to the main branch will not be validated by this action.
134+
### Outputs
135+
136+
```yaml
137+
updated:
138+
description: "Boolean indicating whether code.json was updated"
139+
140+
pr_url:
141+
description: "URL of the created pull request if changes were made via PR"
142+
143+
commit_sha:
144+
description: "SHA of the commit if pushed directly to branch"
145+
146+
method_used:
147+
description: "Method used for the update: 'direct_push' or 'pull_request'"
148+
```
149149
150150
## Setting Up Personal Access Token (PAT)
151151

0 commit comments

Comments
 (0)