Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/MMC-12-implementation-message-co…
Browse files Browse the repository at this point in the history
…re' into MMC-12-implementation-message-core
  • Loading branch information
Vitolo-Andrea committed Jul 8, 2024
2 parents e2dd662 + fd0047b commit eead3de
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--- Please always add a PR description as if nobody knows anything about the context these changes come from. -->
<!--- Even if we are all from our internal team, we may not be on the same page. -->
<!--- Write this PR as you were contributing to a public OSS project, where nobody knows you and you have to earn their trust. -->
<!--- This will improve our projects in the long run! Thanks. -->

### List of changes

<!--- Describe your changes in detail -->

### Motivation and context

<!--- Why is this change required? What problem does it solve? -->

### Type of changes

- [ ] Add new feature
- [ ] Update existing feature
- [ ] Remove existing feature
- [ ] Other changes

### Does this introduce a breaking change?

- [ ] Yes
- [ ] No

### Other information

<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
56 changes: 56 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Validate PR title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-22.04
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
# from https://github.com/amannn/action-semantic-pull-request/commits/main
- uses: amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
types: |
fix
feat
docs
chore
breaking
# Configure that a scope must always be provided.
requireScope: false
# Configure additional validation for the subject based on a regex.
# This example ensures the subject starts with an uppercase character.
subjectPattern: ^[A-Z].+$
# If `subjectPattern` is configured, you can use this property to override
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
starts with an uppercase character.
# For work-in-progress PRs you can typically use draft pull requests
# from Github. However, private repositories on the free plan don't have
# this option and therefore this action allows you to opt-in to using the
# special "[WIP]" prefix to indicate this state. This will avoid the
# validation of the PR title and the pull request checks remain pending.
# Note that a second check will be reported if this is enabled.
wip: true
# When using "Squash and merge" on a PR with only one commit, GitHub
# will suggest using that commit message instead of the PR title for the
# merge commit, and it's easy to commit this by mistake. Enable this option
# to also validate the commit message for one commit PRs.
validateSingleCommit: false
# Related to `validateSingleCommit` you can opt-in to validate that the PR
# title matches a single commit to avoid confusion.
validateSingleCommitMatchesPrTitle: false
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
# Trigger the workflow on push on the main branch
push:
branches:
- main
paths-ignore:
- 'CODEOWNERS'
- '**.md'
- '.**'

jobs:
release:
name: Release
runs-on: ubuntu-22.04

steps:

- name: 🚀 Release with docker action
id: release
uses: pagopa/eng-github-actions-iac-template/global/release-with-docker@main #
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

23 changes: 23 additions & 0 deletions .github/workflows/snapshot-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Snapshot docker build and push

on:
push:
# Sequence of patterns matched against refs/heads
branches-ignore:
- 'main'
paths-ignore:
- 'CODEOWNERS'
- '**.md'
- '.**'

jobs:
release:
name: Snapshot Docker
runs-on: ubuntu-22.04

steps:
- name: 📦 Docker build and push
id: release
uses: pagopa/eng-github-actions-iac-template/global/docker-build-push@main #
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Docker security scan

on:
push:
branches: [ "main", "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "master" ]
schedule:
- cron: '00 07 * * *'

permissions:
contents: read

jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
# from https://github.com/actions/checkout/commits/main
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707

- name: Build an image from Dockerfile
run: |
docker build -t docker.io/my-organization/my-app:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
# from https://github.com/aquasecurity/trivy-action/commits/master
uses: aquasecurity/trivy-action@d63413b0a4a4482237085319f7f4a1ce99a8f2ac
with:
image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
timeout: '10m0s'

- name: Upload Trivy scan results to GitHub Security tab
# from https://github.com/github/codeql-action/commits/main
uses: github/codeql-action/upload-sarif@f0a12816612c7306b485a22cb164feb43c6df818
with:
sarif_file: 'trivy-results.sarif'
13 changes: 13 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [{ "type": "breaking", "release": "major" }]
}
],
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
1 change: 1 addition & 0 deletions force-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1622

0 comments on commit eead3de

Please sign in to comment.