{"id":15777165,"url":"https://github.com/jaywcjlove/action-ejs","last_synced_at":"2025-03-14T08:30:27.266Z","repository":{"id":37027485,"uuid":"470808464","full_name":"jaywcjlove/action-ejs","owner":"jaywcjlove","description":"A github action to render a ejs template using github context","archived":false,"fork":false,"pushed_at":"2024-05-12T05:47:37.000Z","size":672,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-23T01:13:47.490Z","etag":null,"topics":["actions","ejs","github-actions"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/action-ejs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaywcjlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://jaywcjlove.github.io/#/sponsor"}},"created_at":"2022-03-17T01:32:36.000Z","updated_at":"2024-05-12T05:46:12.000Z","dependencies_parsed_at":"2023-01-22T20:20:18.994Z","dependency_job_id":"8036fec1-05f8-430f-8a22-0a1cb3cfb26f","html_url":"https://github.com/jaywcjlove/action-ejs","commit_stats":{"total_commits":64,"total_committers":4,"mean_commits":16.0,"dds":0.171875,"last_synced_commit":"034b78fdfe758d01a0aaca00a4e5e16860e7d2cc"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Faction-ejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Faction-ejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Faction-ejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Faction-ejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/action-ejs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221368951,"owners_count":16806594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","ejs","github-actions"],"created_at":"2024-10-04T17:43:02.324Z","updated_at":"2024-10-25T18:04:18.230Z","avatar_url":"https://github.com/jaywcjlove.png","language":"TypeScript","funding_links":["https://jaywcjlove.github.io/#/sponsor"],"categories":[],"sub_categories":[],"readme":"Action EJS\n===\n\n[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)\n[![CI](https://github.com/jaywcjlove/action-ejs/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/action-ejs/actions/workflows/ci.yml)\n[![TEST](https://github.com/jaywcjlove/action-ejs/actions/workflows/test.yml/badge.svg)](https://github.com/jaywcjlove/action-ejs/actions/workflows/test.yml)\n\nA github action to render a [`ejs`](https://github.com/mde/ejs) template using github context\n\n## Usage\n\n```yml\n- name: action-ejs\n  uses: jaywcjlove/action-ejs@main\n  with:\n    template: \u003ch1\u003e\u003c%= name %\u003e \u003cspan\u003e\u003c%= conclusion %\u003e\u003c/span\u003e\u003c/h1\u003e\n    vars: |\n      { \"name\": \"${{ github.repository }}\", \"conclusion\": \"${{ steps.ejs.conclusion }}\" }\n```\n\n```yml\n- name: action-ejs\n  uses: jaywcjlove/action-ejs@main\n  with:\n    template: \u003cdiv\u003e\u003c%= LICENSE %\u003e\u003c/div\u003e\u003cdiv\u003e\u003c%= markdown %\u003e\u003c/div\u003e\n    output: build/demo.html\n    vars-file: |\n      {\n        \"markdown\": \"./README.md\",\n        \"LICENSE\": \"./LICENSE\"\n      }\n```\n\n```yml\n- name: action-ejs\n  uses: jaywcjlove/action-ejs@main\n  with:\n    template-file: template/demo.html\n    output: build/template/demo.html\n    vars: |\n      { \"htmlContent\": \"${{ env.GITHUB_REF }}\" }\n```\n\nFollowing objects are exposed, and can be used in template file:\n\n- `context`: The [Context](https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts) object in [@actions/github](https://github.com/actions/toolkit/tree/main/packages/github)\n- `process`: The `process.env` object. You can access the environment variables with `env.\u003ckey\u003e`\n\n```yml\n- name: action-ejs\n  uses: jaywcjlove/action-ejs@main\n  with:\n    template: |\n      \u003ch1\u003e\u003c%= env.GITHUB_REF %\u003e\u003c/h1\u003e commiter: \u003c%= context.payload.head_commit.author.name %\u003e\n```\n\n## Inputs\n\n- `template` Input ESJ template string.\n- `template-file` Input ESJ template file path.\n- `vars` Input variables. A dictionary of variables in JSON format to be used in the template. `default: '{}'`\n- `vars-file` Read the contents of the file into a `vars`. `default: '{}'`\n- `options` A JSON format string of options to be passed to the template engine. `default: '{}'`\n- `output` output html path `default: build/index.html`\n\n## Outputs\n\n- `content` template render result: `\u003c!DOCTYPE html\u003e\u003chtml lang=\"en\"\u003e....`.\n\n## See Also\n\n- [Github Release Changelog Generator](https://github.com/jaywcjlove/changelog-generator) A GitHub Action that compares the commit differences between two branches\n- [Create Tags From](https://github.com/jaywcjlove/create-tag-action) Auto create tags from commit or package.json.\n- [Github Action Contributors](https://github.com/jaywcjlove/github-action-contributors) Github action generates dynamic image URL for contributor list to display it!\n- [Generated Badges](https://github.com/jaywcjlove/generated-badges) Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)\n- [Create Coverage Badges](https://github.com/jaywcjlove/coverage-badges-cli) Create coverage badges from coverage reports. (no 3rd parties servers)\n- [Github Action package](https://github.com/jaywcjlove/github-action-package) Read and modify the contents of `package.json`.\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\u003ca href=\"https://github.com/jaywcjlove/action-ejs/graphs/contributors\"\u003e\n  \u003cimg src=\"https://jaywcjlove.github.io/action-ejs/CONTRIBUTORS.svg\" /\u003e\n\u003c/a\u003e\n\nMade with [action-contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n## License\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Faction-ejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Faction-ejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Faction-ejs/lists"}