Skip to content

Commit 1d0d8ad

Browse files
committed
Initial commit
0 parents  commit 1d0d8ad

18 files changed

+665
-0
lines changed

.github/label-commenter-config.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
labels:
2+
- name: invalid
3+
labeled:
4+
issue:
5+
body: Please follow the issue templates.
6+
action: close
7+
pr:
8+
body: Please follow the pull request templates.
9+
action: close
10+
unlabeled:
11+
issue:
12+
body: Thank you for following the template. The repository owner will reply.
13+
action: open
14+
- name: forum
15+
labeled:
16+
issue:
17+
body: |
18+
Please ask questions about GitHub Actions at the following forum.
19+
https://github.community/t5/GitHub-Actions/bd-p/actions
20+
action: close
21+
- name: wontfix
22+
labeled:
23+
issue:
24+
body: This will not be worked on but we appreciate your contribution.
25+
action: close
26+
unlabeled:
27+
issue:
28+
body: This has become active again.
29+
action: open
30+
- name: duplicate
31+
labeled:
32+
issue:
33+
body: This issue already exists.
34+
action: close
35+
- name: good first issue
36+
labeled:
37+
issue:
38+
body: This issue is easy for contributing. Everyone can work on this.

.github/settings.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
# See https://developer.github.com/v3/repos/#edit for all available settings.
5+
6+
# The name of the repository. Changing this will rename the repository
7+
name: awesome-actions
8+
9+
# A short description of the repository that will show up on GitHub
10+
description: This description was created by another fabulous GitHub Action
11+
12+
# A URL with more information about the repository
13+
homepage: https://github.com/features/actions
14+
15+
# A comma-separated list of topics to set on the repository
16+
topics: github, probot, actions
17+
18+
# Either `true` to enable issues for this repository, `false` to disable them.
19+
has_issues: true
20+
21+
# Either `true` to enable projects for this repository, or `false` to disable them.
22+
# If projects are disabled for the organization, passing `true` will cause an API error.
23+
has_projects: true
24+
25+
# Either `true` to enable the wiki for this repository, `false` to disable it.
26+
has_wiki: false
27+
28+
# Either `true` to enable downloads for this repository, `false` to disable them.
29+
has_downloads: true
30+
31+
# Updates the default branch for this repository.
32+
default_branch: master
33+
34+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
35+
# squash-merging.
36+
allow_squash_merge: true
37+
38+
# Either `true` to allow merging pull requests with a merge commit, or `false`
39+
# to prevent merging pull requests with merge commits.
40+
allow_merge_commit: true
41+
42+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
43+
# rebase-merging.
44+
allow_rebase_merge: true
45+
46+
# Labels: define labels for Issues and Pull Requests
47+
labels:
48+
- name: bug
49+
color: CC0000
50+
description: An issue with the system 🐛.
51+
52+
- name: feature
53+
color: 336699
54+
description: New functionality.
55+
56+
- name: first-timers-only
57+
# include the old name to rename an existing label
58+
oldname: Help Wanted
59+
60+
# Milestones: define milestones for Issues and Pull Requests
61+
milestones:
62+
- title: alpha version
63+
description: release of the alpha version to the public
64+
# The state of the milestone. Either `open` or `closed`
65+
state: open
66+
67+
- title: beta version
68+
description: release of the beta version to the public
69+
# The state of the milestone. Either `open` or `closed`
70+
state: open
71+
72+
- title: GA
73+
description: release of the final version to the public
74+
# The state of the milestone. Either `open` or `closed`
75+
state: open
76+
77+
# Collaborators: give specific users access to this repository.
78+
collaborators:
79+
80+
- username: hubot
81+
permission: pull
82+
83+
# NOTE: The APIs needed for teams are not supported yet by GitHub Apps
84+
# https://developer.github.com/v3/apps/available-endpoints/
85+
teams:
86+
- name: core
87+
permission: admin
88+
- name: docs
89+
permission: push
90+
91+
branches:
92+
- name: master
93+
# https://developer.github.com/v3/repos/branches/#update-branch-protection
94+
# Branch Protection settings. Set to null to disable
95+
protection:
96+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
97+
required_pull_request_reviews:
98+
# The number of approvals required. (1-6)
99+
required_approving_review_count: 1
100+
# Dismiss approved reviews automatically when a new commit is pushed.
101+
dismiss_stale_reviews: true
102+
# Blocks merge until code owners have reviewed.
103+
require_code_owner_reviews: true
104+
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
105+
dismissal_restrictions:
106+
users: []
107+
teams: []
108+
# Required. Require status checks to pass before merging. Set to null to disable
109+
required_status_checks:
110+
# Required. Require branches to be up to date before merging.
111+
strict: true
112+
# Required. The list of status checks to require in order to merge into this branch
113+
contexts: []
114+
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
115+
enforce_admins: false
116+
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
117+
restrictions:
118+
users: []
119+
teams: []

.github/workflows/add-stars.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Add Stars
2+
3+
on: [watch]
4+
5+
jobs:
6+
addstars:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: add watcher to readme
11+
run: |
12+
echo -e "\nWe got a :star: from [@${{github.actor}}](https://github.com/${{github.actor}})" >> README.md
13+
14+
- name: Commit changes
15+
uses: elstudio/actions-js-build/commit@v2
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
PUSH_BRANCH: 'master'
19+
20+
21+

.github/workflows/bootstrap.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Bootstrap Repository
2+
on: [push]
3+
4+
jobs:
5+
bootstrap:
6+
if: github.repository != 'octodemo/awesome-actions' && github.repository != 'jonico/awesome-actions'
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Create Issue From File
12+
uses: peter-evans/[email protected]
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
ISSUE_TITLE: Welcome ${{github.actor}}
16+
ISSUE_CONTENT_FILEPATH: ./new-issue.md
17+
ISSUE_LABELS: report, automated issue
18+
19+
- name: Add a project board
20+
run: ./create-board.sh
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Remove bootstrap workflow file from master branch
25+
run: ./scripts/remove-bootstrap-workflow.sh
26+
env:
27+
GITHUB_COM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cats.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Cats
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
cats:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Action Cats
10+
uses: ruairidhwm/action-cats@master
11+
with:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/greetings.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Greetings
2+
3+
on: [pull_request, issues]
4+
5+
jobs:
6+
greeting:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/first-interaction@v1
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}
12+
issue-message: |
13+
# Welcome ${{github.actor}} :tada:
14+
Congrats to your first issue!
15+
![](https://camo.githubusercontent.com/f08021a3c40652e932c61ab2b4a004f3a57b8ff7/687474703a2f2f7261636b2e322e6d736863646e2e636f6d2f6d656469612f5a676b794d44457a4c7a41344c7a41314c7a59794c32467559326876636d3168626934324e6a4a6b5953356e6157594b63416c306148567459676b344e5442344f4455775067706c435770775a772f65333664313462642f3163302f616e63686f726d616e2e6a7067)
16+
17+
pr-message: |
18+
# Welcome ${{github.actor}} :tada:
19+
Congrats to your first PR!
20+
![giphy 2](https://cloud.githubusercontent.com/assets/395397/14451851/3abad496-003f-11e6-9a35-1ba112d981d7.gif)

.github/workflows/label-commenter.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Label Commenter
2+
3+
on:
4+
issues:
5+
types:
6+
- labeled
7+
- unlabeled
8+
pull_request:
9+
types:
10+
- labeled
11+
- unlabeled
12+
13+
jobs:
14+
comment:
15+
runs-on: ubuntu-18.04
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
ref: master
20+
21+
- name: Label Commenter
22+
uses: peaceiris/actions-label-commenter@v1
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
config_file: .github/label-commenter-config.yml

.github/workflows/stale.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Close stale issues"
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v1
11+
with:
12+
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
stale-issue-message: 'This issue is stale because it has been open 1 day with no activity. Remove stale label or comment or this will be closed in 2 days'
14+
stale-pr-message: 'This pr is stale because it has been open 1 day with no activity. Remove stale label or comment or this will be closed in 2 days'
15+
stale-issue-label: 'stale-issue'
16+
exempt-issue-label: 'awaiting-approval'
17+
stale-pr-label: 'stale-pr'
18+
exempt-pr-label: 'awaiting-approval'
19+
days-before-stale: 1
20+
days-before-close: 2

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# awesome-actions
2+
3+
Awesome actions is a repository template that comes with pre-configured GitHub Actions that
4+
* [create project board](.github/workflows/bootstrap.yml)
5+
* [create a welcome issue](.github/workflows/bootstrap.yml) with info on how to use GitHub
6+
* [greets first time contributors to issues and pull requests](.github/workflows/greetings.yml) with a warm welcome message
7+
* [add the names of everybody who stars the repository](.github/workflows/add-stars.yml#L9-L17) in its README
8+
* [mark issues that did not receive comments as stale and closes them](.github/workflows/add-stars.yml) a bit later if there was no recent activity
9+
* [add a cat gif](https://github.blog/2020-04-09-featured-actions-from-the-github-actions-hackathon/#action-cats) to any pull request created to reward pushing code
10+
* [add a template message based on a label](https://github.blog/2020-04-09-featured-actions-from-the-github-actions-hackathon/#actions-label-commenter)
11+
* automatically disables bootstrap workflows after initial execution
12+
13+
Any repository that will use this template as its base will automatically get those workflows enabled. It can be used as a show case on how Open and Inner Source best practices (like welcoming new contributors) as well as bootstrapping project boards can be "codified" and reused and constantly improved as part of a repository template. It also demonstrates how to react on non CI/CD specific events likes issues, pull requests, added stars and peridodic workflow executions.
14+
15+
## How to use this repository
16+
17+
Please do not work with this repository directly unless you like to contribute to its core functionality. Instead, please use it as a repository template and create a new repository for yourself based on this template. All you have to do is to click on the green __Use this template__ button above:
18+
19+
![image](https://user-images.githubusercontent.com/1872314/64283899-a8f1c780-cf58-11e9-8998-55872ef55784.png)
20+
21+
22+
## Actions used in this repository:
23+
24+
- Greeting on first Issue and PR from [this Action](https://github.com/actions/first-interaction)
25+
- Marking issues as stale from [this Action](https://github.com/actions/stale)
26+
- Committing back to the repository to change the README file and disable bootstrapping workflows from [this Action](https://github.com/elstudio/actions-js-build/tree/master/commit)
27+
- Creating first issue from a file from [this Action](https://github.com/peter-evans/create-issue-from-file)
28+
29+
## Contributions welcome
30+
31+
If you have any examples for great Actions as part of a repository template to show case the power of Actions outside traditional CI/CD, we are looking forward to your PRs.
32+
33+
### Star Gazers
34+
35+
We got a :star: from [@jonico](https://github.com/jonico)
36+
37+
We got a :star: from [@ShikhaThakkar](https://github.com/ShikhaThakkar)
38+
39+
We got a :star: from [@ravigadhia](https://github.com/ravigadhia)
40+
41+
We got a :star: from [@i-marsh](https://github.com/i-marsh)
42+
43+
We got a :star: from [@pedrolacerda](https://github.com/pedrolacerda)

create-board.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Creates a Project board with 3 columns to simulate an ongoing sprint
2+
# TODO: create a number of Cards to simulate real action
3+
4+
# TODO: Change back to "application/json" once API is stable.
5+
# See: https://developer.github.com/v3/projects/#create-a-repository-project
6+
ACCEPT_HEADER="application/vnd.github.inertia-preview+json"
7+
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
10+
echo "Creating new Project."
11+
PROJECT_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/project1.json https://api.github.com/repos/${GITHUB_REPOSITORY}/projects | jq .id`
12+
echo "📊 Project created with id: $PROJECT_ID"
13+
14+
echo "Creating Columns"
15+
TODO_COL_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/column1.json https://api.github.com/projects/$PROJECT_ID/columns | jq .id`
16+
echo "[1/3] ✅ TODO column created. id=$TODO_COL_ID"
17+
18+
PROG_COL_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/column2.json https://api.github.com/projects/$PROJECT_ID/columns | jq .id`
19+
echo "[2/3] ✅ In Progress column created. id=$PROG_COL_ID"
20+
21+
DONE_COL_ID=`curl -s -H "Authorization: Token $GITHUB_TOKEN" -H "Accept: $ACCEPT_HEADER" -H "Content-type: application/json" -X POST -d @$DIR/projects/column3.json https://api.github.com/projects/$PROJECT_ID/columns | jq .id`
22+
echo "[3/3] ✅ Done column created. id=$DONE_COL_ID"

0 commit comments

Comments
 (0)