Skip to content

Commit 5c9d4ad

Browse files
authored
Initial commit
0 parents  commit 5c9d4ad

9 files changed

+255
-0
lines changed

.editorconfig

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
# Uses editorconfig to maintain consistent coding styles
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
indent_size = 2
12+
indent_style = space
13+
insert_final_newline = true
14+
max_line_length = 80
15+
trim_trailing_whitespace = true
16+
17+
[*.xml]
18+
charset = utf-8
19+
end_of_line = lf
20+
indent_size = 2
21+
indent_style = space
22+
insert_final_newline = true
23+
max_line_length = 80
24+
trim_trailing_whitespace = true
25+
26+
[*.{tf,tfvars}]
27+
indent_size = 2
28+
indent_style = space
29+
30+
[*.md]
31+
max_line_length = 0
32+
trim_trailing_whitespace = false
33+
34+
# Tab indentation (no size specified)
35+
[Makefile]
36+
tab_width = 2
37+
indent_style = tab
38+
39+
[COMMIT_EDITMSG]
40+
max_line_length = 0

.github/PULL_REQUEST_TEMPLATE.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--- Please always add a PR description as if nobody knows anything about the context these changes come from. -->
2+
<!--- Even if we are all from our internal team, we may not be on the same page. -->
3+
<!--- Write this PR as you were contributing to a public OSS project, where nobody knows you and you have to earn their trust. -->
4+
<!--- This will improve our projects in the long run! Thanks. -->
5+
6+
#### List of Changes
7+
<!--- Describe your changes in detail -->
8+
9+
#### Motivation and Context
10+
<!--- Why is this change required? What problem does it solve? -->
11+
12+
#### How Has This Been Tested?
13+
<!--- Please describe in detail how you tested your changes. -->
14+
<!--- Include details of your testing environment, tests ran to see how -->
15+
<!--- your change affects other areas of the code, etc. -->
16+
17+
#### Screenshots (if appropriate):
18+
19+
#### Types of changes
20+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
21+
- [ ] Chore (nothing changes by a user perspective)
22+
- [ ] Bug fix (non-breaking change which fixes an issue)
23+
- [ ] New feature (non-breaking change which adds functionality)
24+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
25+
26+
#### Checklist:
27+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
28+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
29+
- [ ] My change requires a change to the documentation.
30+
- [ ] I have updated the documentation accordingly.

.github/workflows/anchore.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow checks out code, builds an image, performs a container image
7+
# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security
8+
# code scanning feature. For more information on the Anchore scan action usage
9+
# and parameters, see https://github.com/anchore/scan-action. For more
10+
# information on Anchore's container image scanning tool Grype, see
11+
# https://github.com/anchore/grype
12+
name: Anchore Container Scan
13+
14+
on:
15+
push:
16+
branches: [ "master", "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master", "main" ]
20+
schedule:
21+
- cron: '00 07 * * *'
22+
23+
permissions:
24+
contents: read
25+
26+
env:
27+
DOCKERFILE: Dockerfile
28+
29+
jobs:
30+
Anchore-Build-Scan:
31+
permissions:
32+
contents: read # for actions/checkout to fetch code
33+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
34+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout the code
38+
uses: actions/checkout@v3
39+
- name: Build the Docker image
40+
run: docker build . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest
41+
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
42+
uses: anchore/scan-action@v3
43+
with:
44+
image: "localbuild/testimage:latest"
45+
acs-report-enable: true
46+
fail-build: true
47+
severity-cutoff: "high"
48+
- name: Upload Anchore Scan Report
49+
uses: github/codeql-action/upload-sarif@v2
50+
if: always()
51+
with:
52+
sarif_file: results.sarif

.github/workflows/pr-title.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Validate PR title"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/[email protected]
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
docs
27+
chore
28+
breaking
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# Configure additional validation for the subject based on a regex.
32+
# This example ensures the subject starts with an uppercase character.
33+
subjectPattern: ^[A-Z].+$
34+
# If `subjectPattern` is configured, you can use this property to override
35+
# the default error message that is shown when the pattern doesn't match.
36+
# The variables `subject` and `title` can be used within the message.
37+
subjectPatternError: |
38+
The subject "{subject}" found in the pull request title "{title}"
39+
didn't match the configured pattern. Please ensure that the subject
40+
starts with an uppercase character.
41+
# For work-in-progress PRs you can typically use draft pull requests
42+
# from Github. However, private repositories on the free plan don't have
43+
# this option and therefore this action allows you to opt-in to using the
44+
# special "[WIP]" prefix to indicate this state. This will avoid the
45+
# validation of the PR title and the pull request checks remain pending.
46+
# Note that a second check will be reported if this is enabled.
47+
wip: true
48+
# When using "Squash and merge" on a PR with only one commit, GitHub
49+
# will suggest using that commit message instead of the PR title for the
50+
# merge commit, and it's easy to commit this by mistake. Enable this option
51+
# to also validate the commit message for one commit PRs.
52+
validateSingleCommit: false
53+
# Related to `validateSingleCommit` you can opt-in to validate that the PR
54+
# title matches a single commit to avoid confusion.
55+
validateSingleCommitMatchesPrTitle: false

.github/workflows/release.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
# Trigger the workflow on push on the main branch
5+
push:
6+
branches:
7+
- main
8+
paths-ignore:
9+
- 'CODEOWNERS'
10+
- '**.md'
11+
- '.**'
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
id: checkout
21+
uses: actions/checkout@v2
22+
with:
23+
persist-credentials: false
24+
fetch-depth: 0
25+
26+
- name: Release
27+
id: release
28+
uses: cycjimmy/semantic-release-action@v2
29+
with:
30+
semantic_version: 18.0.0
31+
extra_plugins: |
32+
@semantic-release/[email protected]
33+
@semantic-release/[email protected]
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Log in to the Container registry
38+
id: docker_login
39+
if: steps.release.outputs.new_release_published == 'true'
40+
uses: docker/login-action@v2
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Build and push Docker image
47+
id: docker_build_push
48+
if: steps.release.outputs.new_release_published == 'true'
49+
uses: docker/build-push-action@v3
50+
with:
51+
context: .
52+
push: true
53+
tags: |
54+
ghcr.io/${{ github.repository }}:latest
55+
ghcr.io/${{ github.repository }}:v${{ steps.release.outputs.new_release_version }}
56+
labels: |
57+
maintainer=https://pagopa.it
58+
org.opencontainers.image.source=https://github.com/${{ github.repository }}

.releaserc.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"branches": ["main", "master"],
3+
"ci": false,
4+
"plugins": [
5+
[
6+
"@semantic-release/commit-analyzer",
7+
{
8+
"preset": "angular",
9+
"releaseRules": [{ "type": "breaking", "release": "major" }]
10+
}
11+
],
12+
"@semantic-release/release-notes-generator",
13+
"@semantic-release/github"
14+
]
15+
}

CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# see https://help.github.com/en/articles/about-code-owners#example-of-a-codeowners-file
2+
3+
* @pagopa/infrastructure-admins

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM alpine:latest

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# docker-base-template

0 commit comments

Comments
 (0)