You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-42Lines changed: 42 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,43 +6,21 @@ A GitHub Action that automatically generates and maintains code.json files for f
6
6
7
7
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.
8
8
9
-
## Inputs
9
+
## How It Works
10
10
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**
32
12
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
36
16
37
-
pr_url:
38
-
description: "URL of the created pull request if changes were made via PR"
17
+
**PR Validation**
39
18
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
42
22
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.
46
24
47
25
## Workflow Examples
48
26
@@ -131,21 +109,43 @@ jobs:
131
109
SKIP_PR: "false"
132
110
```
133
111
134
-
### How It Works
112
+
### Inputs
135
113
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 }}
137
119
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
141
123
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"
143
128
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
+
```
147
133
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'"
0 commit comments