Skip to content
file

GitHub Action

publiccode-softwareversion-check-action

v1.2.1 Latest version

publiccode-softwareversion-check-action

file

publiccode-softwareversion-check-action

JavaScript GitHub action to check publiccode.yml softwareVersion and releaseDate automatically

Installation

Copy and paste the following snippet into your .yml file.

              

- name: publiccode-softwareversion-check-action

uses: italia/[email protected]

Learn more about this action in italia/publiccode-softwareversion-check-action

Choose a version

publiccode.yml softwareVersion check action for GitHub

Join the #publiccode channel Get invited

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.

Inputs

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 (default publiccode.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 (default Publiccode bot)

  • gitmail [Optional] - Git mail configuration for bump commit if you use a Pull Request action (default '')

Examples

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

Deal with a remote repository

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]+"

Build the action

Install dependencies

npm i

Build the action

npm run build

Contributing

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.

Maintainers

This software is maintained by the Developers Italia team.

License

© 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.

Remarks

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.