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

Deploy #71

Merged
merged 8 commits into from
Feb 24, 2021
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: '<h1>It''s great having you contribute to this project</h1> <p>Welcome to the community :nerd_face: If any questions please ask</p>'
pr-message: '<h1>It''s great having you contribute to this project</h1> <p>Welcome to the community :nerd_face: If any questions please ask</p>'
footer: 'Join our <a href="http://discord.eddiehub.org">Discord</a> and <a href="http://github.eddiehub.org">GitHub</a> Organisation'

statistics:
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ Example usage (you can change the replies for `issue-message` and `pr-message`)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieJaoudeCommunity/gh-action-community/src/welcome@main
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: '<h1>It''s great having you contribute to this project</h1> Feel free to raise an <strong>Issue</strong>! Welcome to the community :nerd_face:'
pr-message: '<h1>It''s great having you contribute to this project</h1> Feel free to create a <strong>Pull Request</strong>! Welcome to the community :nerd_face:'
```

### Store community acitivity
#### Options

`footer` is an optional parameter, which can be used to append the `issue-message` and `pr-message`

### Store community activity

This GitHub Action will log statistics of user activity to Firestore DB (Firebase)

Expand All @@ -38,7 +42,7 @@ This GitHub Action will log statistics of user activity to Firestore DB (Firebas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieJaoudeCommunity/gh-action-community/src/statistics@main
- uses: EddieHubCommunity/gh-action-community/src/statistics@main
if: ${{ <expression> }}
with:
firebase-key: ${{ secrets.FIREBASE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion src/statistics/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Eddie Jaoude Community Statistic Action'
name: 'EddieHubCommunity Statistic Action'
description: 'Record community activity to be used for badges'
inputs:
firebase-key:
Expand Down
5 changes: 4 additions & 1 deletion src/welcome/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Eddie Jaoude Community Welcome Action'
name: 'EddieHubCommunity Welcome Action'
description: 'Welcome message on new Issues and Pull Requests'
inputs:
github-token:
Expand All @@ -12,6 +12,9 @@ inputs:
description: 'Message to reply to new pull request as a comment'
required: true
default: 'Thank you for creating a Pull Request and contributing to our community project :tada:. Someone from the community will get back to you soon, usually within 24 hours'
footer:
description: 'Append issue and pull request message with this message'
default: ''
runs:
using: 'node12'
main: 'index.js'
8 changes: 4 additions & 4 deletions src/welcome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const github = require('@actions/github');
const githubToken = core.getInput('github-token', { required: true });
const issueMessage = core.getInput('issue-message');
const prMessage = core.getInput('pr-message');
const footer = core.getInput('footer');

// add a comment to the issue or pull request
// @TODO: with a markdown sheild / badge
Expand All @@ -17,22 +18,21 @@ const github = require('@actions/github');
return;
}

const footer = `<p>If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our <a href="https://discord.com/invite/jZQs6Wu">Discord</a> chat and our <a href="https://github.com/EddieJaoudeCommunity">GitHub Organisation</a> - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.</p>
`;
const footerTags = `<p>${footer}</p>`;

if (!!context.payload.issue) {
await client.issues.createComment({
owner: context.issue.owner,
repo: context.issue.repo,
issue_number: context.issue.number,
body: issueMessage + footer
body: issueMessage + footerTags
});
} else {
await client.pulls.createReview({
owner: context.issue.owner,
repo: context.issue.repo,
pull_number: context.issue.number,
body: prMessage + footer,
body: prMessage + footerTags,
event: 'COMMENT'
});
}
Expand Down