From 6091f24899da7815965c4aa94310794b93c42567 Mon Sep 17 00:00:00 2001 From: Britta Stallknecht <146106656+britsta@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:33:31 +0100 Subject: [PATCH] Ensure PR labels and provide PR template (#288) * chore: add pull request template * chore: ensure pull request has label * chore: add list of labels * chore: enable git completion in bash terminal * feat: use minimal set of labels --- .devcontainer/Dockerfile | 4 +++- .github/PULL_REQUEST_TEMPLATE.md | 7 +++++++ .github/settings.yml | 33 ++++++++++++++++++++++++++++++++ .github/workflows/check-pr.yml | 17 ++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/settings.yml create mode 100644 .github/workflows/check-pr.yml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1fa0be947..e50b27a3d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -11,4 +11,6 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/ # && apt-get -y install --no-install-recommends # [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 + +RUN echo '\nsource /usr/share/bash-completion/completions/git' >> /home/vscode/.bashrc \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..da589bf8d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +# Readiness checklist + +- [ ] I ensured that the PR title is good enough. +- [ ] I labeled the PR. +- [ ] I self-reviewed the PR. + + diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 000000000..5bf66b04c --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,33 @@ +--- +# https://github.com/repository-settings/app + +repository: + allow_squash_merge: true + allow_merge_commit: false + allow_rebase_merge: false + allow_auto_merge: true + allow_update_branch: true + delete_branch_on_merge: true + +labels: + - name: bug + color: "#d73a4a" + description: Something isn't working + - name: chore + color: "#c2e0c6" + description: Some routine work like updating dependencies + - name: ci + color: "#DFB5FD" + description: Continuous Integration related stuff + - name: dependencies + color: "#0366d6" + description: Pull requests that update dependencies + - name: enhancement + color: "#a2eeef" + description: New feature or request + - name: refactoring + color: "#880361" + description: Refactoring of code + - name: wip + color: "#32BF4C" + description: Work in Progress (blocks mergify from auto update the branch) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 000000000..cf2050f0c --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,17 @@ +name: Check Pull Request + +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] + +jobs: + validate-pr-label: + name: Validate the Pull Request's labels + runs-on: ubuntu-latest + steps: + - name: PR must be labeled + uses: jesusvasquez333/verify-pr-label-action@v1.4.0 + with: + disable-reviews: true + github-token: "${{ secrets.GITHUB_TOKEN }}" + valid-labels: "bug, chore, ci, dependencies, enhancement, refactoring"