Skip to content

Commit 4bba30f

Browse files
committed
bug fix for the opencatalog.yaml
1 parent 17ba9e3 commit 4bba30f

2 files changed

Lines changed: 47 additions & 3 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The following outputs are provided by the action and can be used by other action
5252
| `version` | New version of the `softwareVersion` field |
5353
| `releaseDate` | New release date of the `releaseDate` field |
5454

55+
5556
## Example
5657
To use this action, simply include it as a step in your workflow file. No inputs are required.
5758

@@ -68,6 +69,29 @@ steps:
6869
````
6970
Note: Replace `your-github-username` with your actual GitHub username, and `publiccode-update-action` with the name of the repository where this action is hosted.
7071

72+
## Tips
73+
Need a quick way to present your project online but don't have the time te create a dedicated website? Combine the publiccode code actions with the product page action to get an instant website for you project.
74+
75+
````yaml
76+
name: My PublicCode Workflow
77+
78+
on:
79+
push:
80+
branches:
81+
- main
82+
83+
jobs:
84+
build:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- name: Update publiccode.yaml
88+
uses: OpenCatalogi/publiccode-action@1
89+
- name: Deploy Product Github Page
90+
uses: OpenCatalogi/productpage-action@1
91+
````
92+
93+
[Read more](https://github.com/marketplace/actions/create-an-product-page) about the product page action
94+
7195
## Architecture
7296
### Why Python?
7397
Python is natively supported by GitHub actions' underlaying containers and therefore very quick
@@ -76,3 +100,14 @@ Python is natively supported by GitHub actions' underlaying containers and there
76100
We follow the "get data from the source" principle, in practice for this action that means that we set the repository as the source. So any settings in the repository (e.g. name and description) will overwrite the values already pressent in your publiccode.
77101

78102
Please note that this action does not handle errors or exceptions while reading metadata or writing to publiccode.yaml. You should ensure that your repository is properly set up to avoid any issues. For example, make sure that your repository name and description are not empty.
103+
104+
## Maintainers
105+
This software is maintained by [Conduction b.v.](https://conduction.nl/)
106+
107+
## License
108+
© 2023 Conduction B.V.
109+
110+
Licensed under the EUPL. The version control system provides attribution for specific lines of code.
111+
112+
## Remarks
113+
This GitHub Action is published in the GitHub Marketplace. As such, you can find the [Terms of Service here](). Also, [here]() you can find the GitHub Marketplace Developer Agreement.

action.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,19 @@ runs:
174174
except FileNotFoundError:
175175
data = {}
176176
177-
# Convert created_at to date format
177+
# Convert created_at to date format
178178
created_at_date = datetime.now().strftime('%Y-%m-%d')
179179
180-
180+
# Initialize missing keys with default values
181+
set_default(data, 'publiccodeYmlVersion', "0.2")
182+
set_default(data, 'name', "")
183+
set_default(data, 'website', "")
184+
set_default(data, 'contact', {})
185+
set_default(data['contact'], 'email', "")
186+
set_default(data['contact'], 'phone', "")
187+
set_default(data, 'softwareOwned', []])
188+
set_default(data, 'softwareUsed', []])
189+
set_default(data, 'softwareSupported', []])
181190
182191
# Write updated opencatalogi.yaml
183192
with open("opencatalogi.yaml", "w") as f:
@@ -201,7 +210,7 @@ runs:
201210
run: |
202211
git config --local user.email "action@github.com"
203212
git config --local user.name "GitHub Action"
204-
git add publicorganisation.yaml
213+
git add opencatalogi.yaml
205214
git commit -m "${{ github.workflow }}" || echo "No changes to commit"
206215
git push
207216
# Post Repository URL to OpenCatalogi API

0 commit comments

Comments
 (0)