diff --git a/.gitattributes b/.gitattributes index 65de6e8..c9f2656 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ /.docker/ export-ignore /.idea/ export-ignore +/.github/ export-ignore /.ahoy.yml export-ignore /.dockerignore export-ignore /.env export-ignore diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..95cbae2 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Checklist before requesting a review + +- [ ] I have formatted the subject to include ticket number as `[#123] Verb in past tense with dot at the end.` +- [ ] I have added a link to the issue tracker +- [ ] I have provided information in `Changed` section about WHY something was done if this was not a normal implementation +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have run new and existing relevant tests locally with my changes, and they passed +- [ ] I have provided screenshots, where applicable + +## Changed + +1. + +## Screenshots diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..8b07383 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,14 @@ +name-template: '$RESOLVED_VERSION' +tag-template: '$RESOLVED_VERSION' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + default: minor +template: | + ## What's new since $PREVIOUS_TAG + + $CHANGES + + **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION + + $CONTRIBUTORS diff --git a/.github/workflows/assign-author.yml b/.github/workflows/assign-author.yml new file mode 100644 index 0000000..a5e7fe1 --- /dev/null +++ b/.github/workflows/assign-author.yml @@ -0,0 +1,18 @@ +name: 'Auto Author Assign' + +on: + pull_request_target: + types: + - opened + - reopened + +permissions: + pull-requests: write + +jobs: + assign-author: + runs-on: ubuntu-latest + + steps: + - name: Assign author + uses: toshimaru/auto-author-assign@v2.1.1 diff --git a/.github/workflows/dispatch-webhook-lagoon.yml b/.github/workflows/dispatch-webhook-lagoon.yml new file mode 100644 index 0000000..5d16cb4 --- /dev/null +++ b/.github/workflows/dispatch-webhook-lagoon.yml @@ -0,0 +1,27 @@ +## +# GitHub Actions workflow to dispatch a PR webhook for a Pull Request. +# +# This is used to allow more granular control over the operations that trigger +# webhooks. +# +# Note that Lagoon's webhook should be disabled in GitHub. + +name: Dispatch a webhook to Lagoon when Pull Request is closed + +on: + pull_request: + types: [closed] + +jobs: + dispatch_webhook_lagoon_remove_environment_pr_closed: + runs-on: ubuntu-latest + steps: + - name: Remove environment after a PR is closed + run: | + cat $GITHUB_EVENT_PATH | curl \ + -X POST \ + --header "Content-Type: application/json" \ + --header "X-GitHub-Delivery: ${RUNNER_TRACKING_ID:7}" \ + --header "X-GitHub-Event: pull_request" \ + --data-binary @- \ + "${LAGOON_WEBHOOK_ENDPOINT-https://hooks.lagoon.amazeeio.cloud/}" diff --git a/.github/workflows/draft-release-notes.yml b/.github/workflows/draft-release-notes.yml new file mode 100644 index 0000000..5ae482c --- /dev/null +++ b/.github/workflows/draft-release-notes.yml @@ -0,0 +1,25 @@ +name: Draft release notes + +on: + push: + tags: + - '*' + branches: + - develop + +permissions: + contents: write + +jobs: + release-drafter: + permissions: + contents: write + pull-requests: write + + runs-on: ubuntu-latest + + steps: + - name: Draft release notes + uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/label-merge-conflict.yml b/.github/workflows/label-merge-conflict.yml new file mode 100644 index 0000000..edbf7de --- /dev/null +++ b/.github/workflows/label-merge-conflict.yml @@ -0,0 +1,18 @@ +name: "Auto-label a PR with a conflict" + +on: + push: + pull_request_target: + types: + - synchronize + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Check if PRs have conflicts + uses: eps1lon/actions-label-merge-conflict@releases/2.x + with: + dirtyLabel: "CONFLICT" + removeOnDirtyLabel: "Needs review" + repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fbd4f8e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + push: + tags: + - '*' + branches: + - production + +permissions: + contents: write + +jobs: + release-drafter: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml new file mode 100644 index 0000000..03983a9 --- /dev/null +++ b/.github/workflows/renovate.yml @@ -0,0 +1,25 @@ +name: Renovate +on: + schedule: + - cron: '1 9 * * 1' +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + - uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.0.1 + - name: Self-hosted Renovate + uses: renovatebot/github-action@v40.2.3 + env: + # Update the value of RENOVATE_GIT_AUTHOR with your own. + RENOVATE_GIT_AUTHOR: 'Renovate Self Hosted ' + RENOVATE_DEPENDENCY_DASHBOARD_TITLE: 'Renovate Dependency Dashboard (self-hosted) by GitHub Actions' + RENOVATE_DEPENDENCY_DASHBOARD: true + RENOVATE_REPOSITORIES: ${{ github.repository }} + RENOVATE_PLATFORM: 'github' + RENOVATE_AUTODISCOVER: false + RENOVATE_DRY_RUN: true + with: + configurationFile: renovate-gh.json + token: ${{ secrets.RENOVATE_TOKEN }}