This action checks whether softwareVersion
and releaseDate
in your
publiccode.yml file is
aligned with the latest tag. It's also ready to work in conjunction with
peter-evans/create-pull-request
action to update fields in publiccode.yml
using a pull request. You can also specify a remote repository, see
Deal with a remote repository
Click Use this template
button to create your action based on this template.
The following inputs briefly explained here are fully declared and documented in the action.yaml:
-
remoterepo
[Optional] - Git url of the remote repository you want to check (default''
) -
publiccode
[Optional] - publiccode.yml path (defaultpubliccode.yml
) -
remove
[Optional] - Regular expression applied to the latest tag to remove characters (default''
) -
filter
[Optional] - Regular expression applied to filter tags (default''
) -
gitname
[Optional] - Git name configuration for bump commit if you use a Pull Request action (defaultPubliccode bot
) -
gitmail
[Optional] - Git mail configuration for bump commit if you use a Pull Request action (default''
)
Include this action in your repo by creating
.github/workflows/publiccode-versioning.yml
and edit where needed:
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Parse publiccode.yml
uses: italia/[email protected]
You can easily create a pull request to update fields in your publiccode.yml
file.
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Parse publiccode.yml
uses: italia/publiccode-softwareversion-check-action
id: pva
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
if: failure()
with:
title: "feat: update softwareVersion ${{ steps.pva.outputs.version }} in publiccode.yml"
branch: feature/publiccode-${{ steps.pva.outputs.version }}
See "Create Pull Request - GitHub action" documentation for more info
If you need to keep your publiccode.yml
in another repository you can still
fetch that repo directly from the action using remoterepo
parameter and use
a cron to check whether the version is changed periodically.
on:
schedule:
- cron: '30 17 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: publiccode-softwareversion-check-action
uses: italia/publiccode-softwareversion-check-action@master
id: pva
with:
remoterepo: "https://github.com/immuni-app/immuni-app-android.git"
Tags may contain extra characters you don't want to put in your SoftwareVersion
.
In that case you can remove unwanted characters using a regular expression in the
remove
parameter.
remove: "Immuni-|build[0-9]+"
Install dependencies
npm i
Build the action
npm run build
Contributing is always appreciated. Feel free to open issues, fork or submit a Pull Request. If you want to know more about how to add new fields, check out CONTRIBUTING.md. In order to support other country-specific extensions in addition to Italy some refactoring might be needed.
This software is maintained by the Developers Italia team.
© 2021 Dipartimento per la Trasformazione Digitale - Presidenza del Consiglio dei Ministri
Licensed under the EUPL. The version control system provides attribution for specific lines of code.
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.