English | Italiano
publiccode-issueopener is a Python-based automation bot designed to ensure the correctness
of publiccode.yml
files in GitHub repositories.
This bot gets the list of repositories in the Italian software catalog
through the developers-italia-api,
checks the validity of the publiccode.yml
file for errors, logs them, and opens GitHub issues
accordingly.
This aids in maintaining the high quality of software catalog metadata, and eventually ensures smooth public code sharing and reuse across different administrations.
- Automated issue generation: Any detected errors in the
publiccode.yml
file automatically trigger the creation of GitHub issues. - publiccode.yml compliance: Ensures publiccode.yml files adhere to the Standard set by the publiccode.yml schema.
publiccode-issueopener
will open issues looking like this:
- Python 3.9 or higher
Install the required Python libraries using pip:
pip install -r requirements.txt
Clone the repository to your local machine.
git clone https://github.com/italia/publiccode-issueopener
cd publiccode-issueopener
You can run the script with the following command:
./publiccode-issueopener.py [--since NUMBER_OF_DAYS]
The --since
option defines the number of past days to analyze in the logs.
By default, the script checks the past day's logs for any publiccode.yml errors.
To use the bot, you'll need to set some environment variables in your system:
BOT_GITHUB_TOKEN
: (required) The GitHub token for the bot, used to authenticate when opening issues in repositoriesGITHUB_USERNAME
: The username of the GitHub bot that will open the issues. Default ispubliccode-validator-bot
API_BASEURL
: The base URL for the API used to retreive the errors in publiccode.yml files. Default ishttps://api.developers.italia.it/v1
We always welcome contributions! Feel free to open issues, fork the repository or submit a Pull Request.
This software is maintained by the Developers Italia team.
Copyright© 2022-present - Presidency of the Council of Ministers (Italy)
This software is released under the EUPL-1.2 license. Please see the LICENSE
file for more details.