From a5e25b9b282df9826bd859e71eeac4d1a61cbdc5 Mon Sep 17 00:00:00 2001 From: Abdurrahman Rajab Date: Mon, 19 Jun 2023 17:45:41 +0300 Subject: [PATCH] docs: improving developer experience (#9432) * feat: add feedback to semantic commits * feat: welcome new contributors * feat: add triggers welcome message * chore: fix lint issue * chore: typos * Fixed spacing * Temporarily making this runnable via Actions page * Removed workflow_call --------- Co-authored-by: Keith Williams --- .github/workflows/semantic-pull-requests.yml | 30 +++++++++++++++++-- .../workflows/welcome-new-contributors.yml | 28 +++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/welcome-new-contributors.yml diff --git a/.github/workflows/semantic-pull-requests.yml b/.github/workflows/semantic-pull-requests.yml index 5585523eec..cda43d3ba8 100644 --- a/.github/workflows/semantic-pull-requests.yml +++ b/.github/workflows/semantic-pull-requests.yml @@ -9,7 +9,7 @@ on: - synchronize permissions: - pull-requests: read + pull-requests: write jobs: validate-pr: @@ -17,5 +17,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 + id: lint_pr_title env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: marocchino/sticky-pull-request-comment@v2 + # When the previous steps fails, the workflow would stop. By adding this + # condition you can continue the execution with the populated error message. + if: always() && (steps.lint_pr_title.outputs.error_message != null) + with: + header: pr-title-lint-error + message: | + Hey there and thank you for opening this pull request! 👋🏼 + + We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. + + Details: + + ``` + ${{ steps.lint_pr_title.outputs.error_message }} + ``` + + # Delete a previous comment when the issue has been resolved + - if: ${{ steps.lint_pr_title.outputs.error_message == null }} + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: pr-title-lint-error + message: | + Thank you for following the naming conventions! 🙏 diff --git a/.github/workflows/welcome-new-contributors.yml b/.github/workflows/welcome-new-contributors.yml new file mode 100644 index 0000000000..146cb445ad --- /dev/null +++ b/.github/workflows/welcome-new-contributors.yml @@ -0,0 +1,28 @@ +name: "Welcome new contributors" + +on: + issues: + types: opened + pull_request: + types: opened + +permissions: + pull-requests: write + issues: write + +jobs: + welcome-message: + name: Welcoming New Users + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: semantics + if: github.event.action == 'opened' + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + pr-message: |- + Thank you for making your first Pull Request and taking the time to improve Cal.com ! ❤️🎉 + Feel free to join the conversation at [slack](https://calendso.slack.com/) + issue-message: | + Thank you for opening your first issue, one of our team members will review it as soon as it possible. ❤️🎉