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
+29-15Lines changed: 29 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,9 @@ To use this action, simply include it as a step in your workflow file. No inputs
9
9
````yaml
10
10
name: My PublicCode Workflow
11
11
12
+
permissions:
13
+
contents: write
14
+
12
15
on:
13
16
push:
14
17
branches:
@@ -24,30 +27,38 @@ jobs:
24
27
25
28
In the above example a `publiccode` file is updated every time code on the `main` branche is touched
26
29
27
-
> **Warning**
28
-
> If you do not supply the action with an access token or an SSH key, you must access your repositories settings and provide `Read and Write Permissions` to the provided `GITHUB_TOKEN`, otherwise you'll potentially run into permission issues. Alternatively you can set the following in your workflow file to grant the action the permissions it needs.
30
+
> **Info**
31
+
> Alternatively to setting the write permission for the workflow, you can also supply the action with an access token or an SSH key; see inputs for more details.
32
+
33
+
## Working with protected branches
34
+
It is common (and good) practise to protect the main branche of a repository from direct file editing and only allowing this trough pull requests. This will however couse the action (and workflow containing it) to fail becouse the workflow won't have the rights to actually write or create the resulting publiccode or opencatalogi files to the repository.
35
+
36
+
The sollution here is two run the action two time's
37
+
1- Once on the protected branche with the setting `save` set on false to prevent actual file creation or allteration
38
+
2- Once on a branche where files may actually be added without a pull request (normally dev or development) setting `federlize` set on false to prevent unnececcery upates to the network
0 commit comments