diff --git a/.github/workflows/checker.yml b/.github/workflows/checker.yml new file mode 100644 index 0000000..9c6ed5a --- /dev/null +++ b/.github/workflows/checker.yml @@ -0,0 +1,33 @@ +# https://github.com/amannn/action-semantic-pull-request +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/configuring-commit-squashing-for-pull-requests + +name: Conventional Commits Checks + +on: + workflow_run: + workflows: ["Release Drafter Auto Labeler"] + types: + - completed + +#concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number }} +# cancel-in-progress: true + +jobs: + + check-conventional-commits-labels: + name: Check conventional commits labels + runs-on: [ self-hosted ] + steps: + - uses: danielchabr/pr-labels-checker@v3.1 + with: + hasSome: feature,fix,changed,deprecated,removed,security,docs,dependencies + githubToken: ${{ secrets.GITHUB_TOKEN }} + + validate-pull-request-title: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..5cf6245 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,38 @@ +name: CodeQL + +on: + push: + branches: [ develop, main ] + pull_request: + branches: [ develop, main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} + cancel-in-progress: true + +jobs: + analyze: + strategy: + fail-fast: false + matrix: + language: [ csharp ] + + permissions: + security-events: write + + runs-on: ubuntu-22.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/release-drafter-labeler.yml b/.github/workflows/release-drafter-labeler.yml new file mode 100644 index 0000000..dfae2e3 --- /dev/null +++ b/.github/workflows/release-drafter-labeler.yml @@ -0,0 +1,21 @@ +name: Release Drafter Auto Labeler + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + +jobs: + auto-labeler: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + disable-releaser: true # only run auto-labeler for PRs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..5e1d3dd --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,20 @@ + # https://johanneskonings.dev/github/2021/02/28/github_automatic_releases_and-changelog/ + # https://tiagomichaelsousa.dev/articles/stop-writing-your-changelogs-manually + name: Release Drafter + + on: + push: + branches: + - develop + - main + + jobs: + update_release_draft: + name: Release drafter + runs-on: ubuntu-latest + + steps: + - name: Update Release Draft + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 0000000..c82b5c8 --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -0,0 +1,30 @@ + on: + release: + types: + - released + push: + branches: + - main + +# Every push to main will create a new release and deploy to production. + jobs: + update: + name: Update Changelog + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ github.event.release.name }} + release-notes: ${{ github.event.release.body }} + + - name: Commit updated Changelog + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: 'docs(changelog): update changelog' + file_pattern: CHANGELOG.md