Skip to content

Commit 615d79c

Browse files
committed
feat: initial commit
1 parent f3ee24a commit 615d79c

22 files changed

+856
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git
2+
clone
3+
node_modules

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
GITHUB_ACTOR=
2+
GITHUB_REPOSITORY=
3+
4+
GITHUB_TOKEN=
5+
GIT_EMAIL=

.gitattributes

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
## GITATTRIBUTES FOR WEB PROJECTS
2+
#
3+
# These settings are for any web project.
4+
#
5+
# Details per file setting:
6+
# text These files should be normalized (i.e. convert CRLF to LF).
7+
# binary These files are binary and should be left untouched.
8+
#
9+
# Note that binary is a macro for -text -diff.
10+
######################################################################
11+
12+
# Auto detect
13+
## Handle line endings automatically for files detected as
14+
## text and leave all files detected as binary untouched.
15+
## This will handle all files NOT defined below.
16+
* text=auto
17+
18+
# Source code
19+
*.bash text eol=lf
20+
*.bat text eol=crlf
21+
*.cmd text eol=crlf
22+
*.coffee text
23+
*.css text
24+
*.htm text diff=html
25+
*.html text diff=html
26+
*.inc text
27+
*.ini text
28+
*.js text
29+
*.json text
30+
*.jsx text
31+
*.less text
32+
*.ls text
33+
*.map text -diff
34+
*.od text
35+
*.onlydata text
36+
*.php text diff=php
37+
*.pl text
38+
*.ps1 text eol=crlf
39+
*.py text diff=python
40+
*.rb text diff=ruby
41+
*.sass text
42+
*.scm text
43+
*.scss text diff=css
44+
*.sh text eol=lf
45+
*.sql text
46+
*.styl text
47+
*.tag text
48+
*.ts text
49+
*.tsx text
50+
*.xml text
51+
*.xhtml text diff=html
52+
53+
# Docker
54+
Dockerfile text
55+
56+
# Documentation
57+
*.ipynb text
58+
*.markdown text
59+
*.md text
60+
*.mdwn text
61+
*.mdown text
62+
*.mkd text
63+
*.mkdn text
64+
*.mdtxt text
65+
*.mdtext text
66+
*.txt text
67+
AUTHORS text
68+
CHANGELOG text
69+
CHANGES text
70+
CONTRIBUTING text
71+
COPYING text
72+
copyright text
73+
*COPYRIGHT* text
74+
INSTALL text
75+
license text
76+
LICENSE text
77+
NEWS text
78+
readme text
79+
*README* text
80+
TODO text
81+
82+
# Templates
83+
*.dot text
84+
*.ejs text
85+
*.haml text
86+
*.handlebars text
87+
*.hbs text
88+
*.hbt text
89+
*.jade text
90+
*.latte text
91+
*.mustache text
92+
*.njk text
93+
*.phtml text
94+
*.tmpl text
95+
*.tpl text
96+
*.twig text
97+
*.vue text
98+
99+
# Configs
100+
*.cnf text
101+
*.conf text
102+
*.config text
103+
.editorconfig text
104+
.env text
105+
.gitattributes text
106+
.gitconfig text
107+
.htaccess text
108+
*.lock text -diff
109+
package-lock.json text -diff
110+
*.toml text
111+
*.yaml text
112+
*.yml text
113+
browserslist text
114+
Makefile text
115+
makefile text
116+
117+
# Heroku
118+
Procfile text
119+
120+
# Graphics
121+
*.ai binary
122+
*.bmp binary
123+
*.eps binary
124+
*.gif binary
125+
*.gifv binary
126+
*.ico binary
127+
*.jng binary
128+
*.jp2 binary
129+
*.jpg binary
130+
*.jpeg binary
131+
*.jpx binary
132+
*.jxr binary
133+
*.pdf binary
134+
*.png binary
135+
*.psb binary
136+
*.psd binary
137+
# SVG treated as an asset (binary) by default.
138+
*.svg text
139+
# If you want to treat it as binary,
140+
# use the following line instead.
141+
# *.svg binary
142+
*.svgz binary
143+
*.tif binary
144+
*.tiff binary
145+
*.wbmp binary
146+
*.webp binary
147+
148+
# Audio
149+
*.kar binary
150+
*.m4a binary
151+
*.mid binary
152+
*.midi binary
153+
*.mp3 binary
154+
*.ogg binary
155+
*.ra binary
156+
157+
# Video
158+
*.3gpp binary
159+
*.3gp binary
160+
*.as binary
161+
*.asf binary
162+
*.asx binary
163+
*.fla binary
164+
*.flv binary
165+
*.m4v binary
166+
*.mng binary
167+
*.mov binary
168+
*.mp4 binary
169+
*.mpeg binary
170+
*.mpg binary
171+
*.ogv binary
172+
*.swc binary
173+
*.swf binary
174+
*.webm binary
175+
176+
# Archives
177+
*.7z binary
178+
*.gz binary
179+
*.jar binary
180+
*.rar binary
181+
*.tar binary
182+
*.zip binary
183+
184+
# Fonts
185+
*.ttf binary
186+
*.eot binary
187+
*.otf binary
188+
*.woff binary
189+
*.woff2 binary
190+
191+
# Executables
192+
*.exe binary
193+
*.pyc binary
194+
195+
# RC files (like .babelrc or .eslintrc)
196+
*.*rc text
197+
198+
# Ignore files (like .npmignore or .gitignore)
199+
*.*ignore text

.github/CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project lead at [borj@cans.eco](mailto:borj@cans.eco). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

.github/CONTRIBUTING.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Contributing guide
2+
3+
Thanks for considering a contribution to this project! 🙏
4+
5+
## Local development with Docker 🐳
6+
7+
### Requirements 📝
8+
9+
* [git](https://git-scm.com)
10+
* [Docker](https://docs.docker.com/get-docker/)
11+
12+
### Setup 🛠
13+
14+
1. Clone and navigate to the repo:
15+
```console
16+
$ git clone https://github.com/bcanseco/github-contribution-graph-action.git
17+
$ cd github-contribution-graph-action
18+
```
19+
1. Create an `.env` file:
20+
```console
21+
$ cp .env.example .env
22+
```
23+
1. Fill in the values.
24+
* `GITHUB_ACTOR`: Set this to your GitHub username.
25+
* e.g. `bcanseco`
26+
* Note that when running as a GitHub Action, the user doesn't need to provide this.
27+
* `GITHUB_REPOSITORY`: Set this to your username followed by a slash and your repository name.
28+
* e.g. `bcanseco/github-contribution-graph-action`
29+
* Again, this is only necessary when running locally.
30+
* `GITHUB_TOKEN`: Set this to [your personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
31+
* Make sure to check the **Repo** boxes.
32+
* Note that the personal access token has more permissions than the `GITHUB_TOKEN` provided by the Actions runner. Read more about this [here](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token).
33+
* `GIT_EMAIL`: Set this to [an email associated with your GitHub account](https://github.com/settings/emails).
34+
1. Make sure your Docker daemon is running.
35+
36+
### Running 👟
37+
38+
Use the commands below to build and run a container:
39+
40+
```console
41+
$ docker build -t github-contribution-graph-action .
42+
$ docker run -w /app --rm github-contribution-graph-action
43+
```
44+
45+
You can alternatively run `npm start` directly without Docker, but this isn't recommended.
46+
47+
## Q&A 🤔
48+
49+
### Why is this a Docker action and not a JavaScript action? 📦
50+
51+
Two reasons:
52+
53+
1. For things like this that mess with the `git` CLI directly, it's easier to test with containers.
54+
1. You cannot currently specify an [npm run-script](https://docs.npmjs.com/cli/run-script) (e.g. `npm start`) as an entrypoint with JavaScript actions.
55+
56+
### Why go with Unix rather than ISO for `ORIGIN_TIMESTAMP`? ⌚
57+
58+
For some reason, the GitHub Actions runner mutates ISO timestamp strings passed as environment variables into something unparseable by the `date-fns` library.
59+
60+
### Why use environment variables instead of [inputs][inputs]? 🔌
61+
62+
[inputs]: https://help.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs
63+
64+
Two reasons:
65+
66+
1. GitHub transforms input parameter casing and prepends `INPUT_`, so additional code would be necessary to revert this before processing them.
67+
1. Input parameters are expected to be documented in the [action definition](../action.yml), which would be yet another source of truth to maintain.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help me improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**Brief overview:** <!-- Write a summary of what this PR does below. Screenshots are cool! -->
2+
3+
4+
**Changelog:**
5+
* <!-- Completed item 1 -->
6+
* <!-- Completed item 2 -->
7+
* <!-- etc. -->
8+
9+
**Steps to test/confirm my changes:**
10+
1. <!-- Step 1 -->
11+
2. <!-- Step 2 -->
12+
3. <!-- etc. -->

.github/SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Security Policy
2+
3+
Please email [borj@cans.eco](mailto:borj@cans.eco) if you find a security vulnerability on this project. If you find a *potential* vulnerability, feel free to leave an issue and I'll respond ASAP.
4+
5+
Thanks for disclosing responsibly 🖤

.github/images/cover.png

705 KB
Loading

0 commit comments

Comments
 (0)