Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/42lm/zigist
Update a gist with a random dev joke. Pure Zig⚡
https://github.com/42lm/zigist
actions continuous-integration cron cronjob githubci zig ziglang
Last synced: about 1 month ago
JSON representation
Update a gist with a random dev joke. Pure Zig⚡
- Host: GitHub
- URL: https://github.com/42lm/zigist
- Owner: 42LM
- License: mit
- Created: 2023-07-27T21:09:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T17:00:55.000Z (about 2 months ago)
- Last Synced: 2025-01-02T17:43:52.426Z (about 2 months ago)
- Topics: actions, continuous-integration, cron, cronjob, githubci, zig, ziglang
- Language: Zig
- Homepage:
- Size: 79.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zigist - Update a gist with a random dev joke
[](https://github.com/42LM/zigist/actions/workflows/test.yaml) [](https://github.com/42LM/zigist/actions/workflows/cron.yaml)Nothing fancy here. This is just a simple github action to update a gist with a random dev joke using [Zig ⚡️](https://github.com/ziglang/zig).
## Quick start
```yaml
uses: 42LM/zigist@v1
with:
gh-token: ${{ secrets.GH_TOKEN }}
gist-id: e35b7dfc8ec2c958a7f8f0c9938ffd60
```> [!TIP]
> Pin the gist in your profile:
>
>![]()
>
> [See it in ~action~ the wild](https://github.com/42LM)## Inputs
|Input Name|Description|Required|
| --- | --- | :---: |
|`gh-token`|The GitHub [Personal Access Token](https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with *gist* access|☑️|
|`gist-id`|The GitHub public gist id|☑️|> [!IMPORTANT]
> #### `gh-token`: The GitHub Token needs to be created as a repository secret in the repository that uses this action.[^1]
> #### `gist-id`: The GitHub gist needs to be created with the file name `NEWS.md`.[^2]## Example usage
https://github.com/42LM/zigist/blob/772cf37d3bf22d435f5aa8459b65a6a150d69e7f/.github/workflows/cron.yaml#L1-L16## Local environment setup
The following two environment variables need to be set up:
1. `GH_TOKEN`: Create a github token that has access to gists.
2. `GIST_ID`: Create a gist.Copy `.envrc.example` to `.envrc` and edit values. Load this environment into your shell, for example with [direnv](https://direnv.net/).
```sh
cp .envrc.example .envrc
```### Zig
```sh
zig build run
``````sh
zig build test --summary all
```### Docker
```sh
docker build -t ziglang/static-v0.13.0 .
``````sh
docker run --name zigist ziglang/static-v0.13.0 $GH_TOKEN $GIST_ID
```[^1]: Place repository secret: 
[^2]: Create github gist with filename `NEWS.md`: 