mirror of
https://github.com/bcanseco/github-contribution-graph-action.git
synced 2025-10-09 13:41:58 +03:00
2.8 KiB
2.8 KiB
Contributing guide
Thanks for considering a contribution to this project! 🙏
Local development with Docker 🐳
Requirements 📝
Setup 🛠
- Clone and navigate to the repo:
$ git clone https://github.com/bcanseco/github-contribution-graph-action.git $ cd github-contribution-graph-action - Create an
.envfile:$ cp .env.example .env - Fill in the values.
GITHUB_ACTOR: Set this to your GitHub username.- e.g.
bcanseco - Note that when running as a GitHub Action, the user doesn't need to provide this.
- e.g.
GITHUB_REPOSITORY: Set this to your username followed by a slash and your repository name.- e.g.
bcanseco/github-contribution-graph-action - Again, this is only necessary when running locally.
- e.g.
GITHUB_TOKEN: Set this to your personal access token.- Make sure to check the Repo boxes.
- Note that the personal access token has more permissions than the
GITHUB_TOKENprovided by the Actions runner. Read more about this here.
GIT_EMAIL: Set this to an email associated with your GitHub account.
- Make sure your Docker daemon is running.
Running 👟
Use the commands below to build and run a container:
$ docker build -t github-contribution-graph-action .
$ docker run --rm github-contribution-graph-action
You can alternatively run npm start directly without Docker, but this isn't recommended.
Q&A 🤔
Why is this a Docker action and not a JavaScript action? 📦
Two reasons:
- For things like this that mess with the
gitCLI directly, it's easier to test with containers. - You cannot currently specify an npm run-script (e.g.
npm start) as an entrypoint with JavaScript actions.
Why go with Unix rather than ISO for ORIGIN_TIMESTAMP? ⌚
For some reason, the GitHub Actions runner mutates ISO timestamp strings passed as environment variables into something unparseable by the date-fns library.
Why use environment variables instead of inputs? 🔌
Two reasons:
- GitHub transforms input parameter casing and prepends
INPUT_, so additional code would be necessary to revert this before processing them. - Input parameters are expected to be documented in the action definition, which would be yet another source of truth to maintain.