Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for welcome-bot workflow #152

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/allo-allo.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/welcome-bot-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: welcome-bot

on:
issues:
types:
- opened
pull_request_target:
branches:
- main
types:
- opened
- closed

jobs:
welcome-bot:
uses: mdn/workflows/.github/workflows/welcome-bot.yml@main
with:
target-repo: "mdn/workflows"
issue-welcome: >
It looks like this is your first issue. Welcome! 👋
One of the project maintainers will be with you as soon as possible. We
appreciate your patience. To safeguard the health of the project, please
take a moment to read our [code of conduct](../blob/main/CODE_OF_CONDUCT.md).
pr-welcome: >
It looks like this is your first pull request. 🎉
Thank you for your contribution! One of the project maintainers will triage
and assign the pull request for review. We appreciate your patience. To
safeguard the health of the project, please take a moment to read our
[code of conduct](../blob/main/CODE_OF_CONDUCT.md).
61 changes: 32 additions & 29 deletions .github/workflows/welcome-bot.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
name: "AlloAllo"
name: welcome-bot

on:
issues:
types:
- opened
pull_request_target:
branches:
- main
types:
- opened
- closed
workflow_call:
inputs:
target-repo:
description: The repo to run this action on. This is to prevent actions from running on forks unless intended.
required: true
type: string
issue-welcome:
description: Message to show to a contributor opening their first issue.
required: false
type: string
pr-welcome:
description: Message to show to a contributor opening their first pull request.
required: false
type: string

permissions:
contents: none
issues: write
pull-requests: write

jobs:
allo-allo:
uses: mdn/workflows/.github/workflows/allo-allo.yml@main
with:
target-repo: "mdn/workflows"
issue-welcome: >
It looks like this is your first issue. Welcome! 👋
One of the project maintainers will be with you as soon as possible. We
appreciate your patience. To safeguard the health of the project, please
take a moment to read our [code of conduct](../blob/main/CODE_OF_CONDUCT.md).
pr-welcome: >
It looks like this is your first pull request. 🎉
Thank you for your contribution! One of the project maintainers will triage
and assign the pull request for review. We appreciate your patience. To
safeguard the health of the project, please take a moment to read our
[code of conduct](../blob/main/CODE_OF_CONDUCT.md).
pr-merged: >
Congratulations on your first merged pull request. 🎉 Thank you for your contribution!
Did you know we have a [project board](https://github.com/orgs/mdn/projects/25) with high-impact contribution opportunities?
We look forward to your next contribution.
welcome-bot:
if: github.repository == inputs.target-repo
name: The MDN Web Docs welcome bot
runs-on: ubuntu-latest

steps:
- name: welcome-bot
uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: ${{ inputs.issue-welcome }}
pr-message: ${{ inputs.pr-welcome }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Reusable GitHub Actions workflows for use in MDN repositories.

## Available actions

- [allo-allo](.github/workflows/allo-allo.yml) ([docs](docs/allo-allo.md)) - a welcome bot for new contributors
- [auto-merge](.github/workflows/auto-merge.yml) ([docs](docs/auto-merge.md)) - automatically merge pull requests
- [idle](.github/workflows/idle.yml) ([docs](docs/idle.md)) - mark issues and pull requests as idle
- [lock-closed](.github/workflows/lock-closed.yml) ([docs](docs/lock-closed.md)) - lock closed issues and pull requests
Expand All @@ -13,3 +12,4 @@ Reusable GitHub Actions workflows for use in MDN repositories.
- [pr-rebase-needed](.github/workflows/pr-rebase-needed.yml) ([docs](docs/pr-rebase-needed.md)) - label pull requests that have merge conflicts
- [publish-release](.github/workflows/publish-release.yml) ([docs](docs/publish-release.md)) - publish a release to GitHub and NPM
- [set-default-labels](.github/workflows/set-default-labels.yml) ([docs](docs/set-default-labels.md)) - set default labels on new issues and pull requests
- [welcome-bot](.github/workflows/welcome-bot.yml) ([docs](docs/welcome-bot.md)) - a welcome bot for new contributors
59 changes: 12 additions & 47 deletions docs/allo-allo.md → docs/welcome-bot.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Allo-Allo
# welcome-bot

The `Allo-Allo` reusable action is located at [`.github/workflows/allo-allo.yml`](https://github.com/mdn/workflows/tree/main/.github/workflows/allo-allo.yml).
The `welcome-bot` reusable action is located at [`.github/workflows/welcome-bot.yml`](https://github.com/mdn/workflows/tree/main/.github/workflows/welcome-bot.yml).

This workflow is added to repositories to welcome new contributors and congratulate them on their first successful pull request merge.
You can specify all three inputs or a single input depending on your needs.

This reusable action depends on the following actions:

- [Allo-Allo](https://github.com/mechanical-ink/allo-allo)
- [welcome-bot](https://github.com/actions/first-interaction)

## Inputs

Expand All @@ -19,7 +19,7 @@ The action has the following inputs:

Specify the target repository this action should run on. This is used to prevent actions from running on repositories other than the target repository. For example, specifying a `target-repo` of `mdn/workflows` will prevent the action from running on forks of `mdn/workflows`.

- This `input` is required
- This `input` is required.

### Optional inputs

Expand All @@ -35,18 +35,12 @@ Message to show to a contributor opening their first pull request.

- This `input` is optional.

#### pr-merged

Message to show to a contributor after first merged pull request.

- This `input` is optional.

## Usage

The following will run on first issue creation, first opened pull request, and first merged pull request.

```yml
name: "AlloAllo"
name: welcome-bot

on:
issues:
Expand All @@ -60,8 +54,8 @@ on:
- closed

jobs:
allo-allo:
uses: mdn/workflows/.github/workflows/allo-allo.yml@main
welcome-bot:
uses: mdn/workflows/.github/workflows/welcome-bot.yml@main
with:
target-repo: "mdn/workflows"
issue-welcome: >
Expand All @@ -75,18 +69,14 @@ jobs:
and assign the pull request for review. We appreciate your patience. To
safeguard the health of the project, please take a moment to read our
[code of conduct](../blob/main/CODE_OF_CONDUCT.md).
pr-merged: >
Congratulations on your first merged pull request. 🎉 Thank you for your contribution!
Did you know we have a [project board](https://github.com/orgs/mdn/projects/25) with high-impact contribution opportunities?
We look forward to your next contribution.
```

### Comment on first issue

The following will run on first issue creation.

```yml
name: "AlloAllo"
name: welcome-bot

on:
issues:
Expand All @@ -95,7 +85,7 @@ on:

jobs:
allo-allo:
uses: mdn/workflows/.github/workflows/allo-allo.yml@main
uses: mdn/workflows/.github/workflows/welcome-bot.yml@main
with:
target-repo: "mdn/workflows"
issue-welcome: |
Expand All @@ -110,7 +100,7 @@ jobs:
The following will run on first opened pull request.

```yml
name: "AlloAllo"
name: welcome-bot

on:
pull_request_target:
Expand All @@ -120,8 +110,8 @@ on:
- opened

jobs:
allo-allo:
uses: mdn/workflows/.github/workflows/allo-allo.yml@main
welcome-bot:
uses: mdn/workflows/.github/workflows/welcome-bot.yml@main
with:
target-repo: "mdn/workflows"
pr-welcome: >
Expand All @@ -131,28 +121,3 @@ jobs:
safeguard the health of the project, please take a moment to read our
[code of conduct](../blob/main/CODE_OF_CONDUCT.md).
```

### Comment on first merged pull request

The following will run on the first merged pull request.

```yml
name: "AlloAllo"

on:
pull_request_target:
branches:
- main
types:
- closed

jobs:
allo-allo:
uses: mdn/workflows/.github/workflows/allo-allo.yml@main
with:
target-repo: "mdn/workflows"
pr-merged: >
Congratulations on your first merged pull request. 🎉 Thank you for your contribution!
Did you know we have a [project board](https://github.com/orgs/mdn/projects/25) with high-impact contribution opportunities?
We look forward to your next contribution.
```
Loading