From 70fd4cfa0a4d02293f754670d1dddacbc7ec8e8a Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Mon, 13 Sep 2021 12:04:15 -0700 Subject: [PATCH 1/2] Add new job to leave comment to new contributor --- .github/workflows/preDeploy.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index 631854d7b4d3..f1257fd8c76b 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -137,3 +137,40 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} + newContributorReminder: + runs-on: ubuntu-latest + steps: + # Version: 2.3.4 + - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f + with: + fetch-depth: 0 + token: ${{ secrets.OS_BOTIFY_TOKEN }} + + - name: Get merged pull request + id: getMergedPullRequest + # TODO: Point back action actions-ecosystem after https://github.com/actions-ecosystem/action-get-merged-pull-request/pull/223 is merged + uses: roryabraham/action-get-merged-pull-request@7a7a194f6ff8f3eef58c822083695a97314ebec1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get PR count for ${{ steps.getMergedPullRequest.outputs.author }} + run: echo "PR_COUNT=$(gh pr list --author ${{ steps.getMergedPullRequest.outputs.author }} --state any | grep -c '')" >> $GITHUB_ENV + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Comment on ${{ steps.getMergedPullRequest.outputs.author }}\'s first pull request! + if: ${{ fromJSON(env.PR_COUNT) == 1 }} + uses: actions-ecosystem/action-create-comment@cd098164398331c50e7dfdd0dfa1b564a1873fac + with: + github_token: ${{ secrets.OS_BOTIFY_TOKEN }} + number: ${{ steps.getMergedPullRequest.outputs.number }} + body: | + @${{ steps.getMergedPullRequest.outputs.author }}, Great job getting your first Expensify/App pull request over the finish line! :tada: + + I know there's a lot of information in our [contributing guidelines](https://github.com/Expensify/App/blob/main/CONTRIBUTING.md), so here are some points to take note of :memo:: + + 1. Now that your first PR has been merged, you can be hired for another issue. Once you've completed a few issues, you may be eligible to work on more than one job at a time. + 2. Once your PR is deployed to our staging servers, it will undergo quality assurance (QA) testing. If we find that it doesn't work as expected or causes a regression, you'll be responsible for fixing it. Typically, we would revert this PR and give you another chance to create a similar PR without causing a regression. + 3. Once your PR is deployed to _production_, we start a 7-day timer :alarm_clock:. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job. :moneybag: + + So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! :blush: From b2dbefabfa40249aaabae23d1fdf4b591765ecbe Mon Sep 17 00:00:00 2001 From: Aldo Canepa Date: Mon, 13 Sep 2021 17:24:17 -0700 Subject: [PATCH 2/2] Removed fetch-depth, renamed job, skip botify --- .github/workflows/preDeploy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index f1257fd8c76b..776b14e78863 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -137,13 +137,14 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - newContributorReminder: + + newContributorWelcomeMessage: runs-on: ubuntu-latest + if: ${{ github.actor != 'OSBotify' }} steps: # Version: 2.3.4 - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f with: - fetch-depth: 0 token: ${{ secrets.OS_BOTIFY_TOKEN }} - name: Get merged pull request