Skip to content

feat(report-gen): [PAGOPA-2212] introducing automatic report generation for statistics publication #712

feat(report-gen): [PAGOPA-2212] introducing automatic report generation for statistics publication

feat(report-gen): [PAGOPA-2212] introducing automatic report generation for statistics publication #712

Workflow file for this run

name: Check PR
# Controls when the workflow will run
on:
pull_request:
branches:
- main
types: [ opened, synchronize, labeled, unlabeled, reopened, edited ]
permissions:
pull-requests: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check_labels:
name: Check Required Labels
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Verify PR Labels
if: ${{ !contains(github.event.pull_request.labels.*.name, 'patch') && !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') }}
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var comments = await github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
for (const comment of comments.data) {
if (comment.body.includes('This pull request does not contain a valid label')){
github.rest.issues.deleteComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id
})
}
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This pull request does not contain a valid label. Please add one of the following labels: `[patch, ignore-for-release]`'
})
core.setFailed('Missing required labels')
check_size:
runs-on: ubuntu-latest
name: Check Size
steps:
- name: Dump GitHub context
run: echo $JSON
env:
JSON: ${{ toJSON(github) }}
- name: Check PR Size
uses: pagopa/github-actions-template/check-pr-size@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
ignored_files: 'openapi'