A GitHub Action to generate QR code images from text or URLs.
- Generate QR codes as PNG or SVG images
- Customizable width and margin
steps:
- name: Generate QR Code
uses: VeyronSakai/[email protected]
with:
text: 'https://github.com/VeyronSakai/qr-code-generator'
output-path: 'qrcode.png'| Name | Description | Required | Default |
|---|---|---|---|
text |
The text to encode into the QR code | Yes | - |
output-path |
File path where the generated QR code image will be saved | Yes | - |
width |
Width of the QR code image in pixels | No | 256 |
margin |
Quiet zone size around the QR code | No | 1 |
type |
Output format type (png or svg) |
No | png |
name: Generate QR Code
on: [push]
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Generate QR Code
uses: VeyronSakai/[email protected]
with:
text: ${{ github.server_url }}/${{ github.repository }}
output-path: repo-qr.png
- name: Upload QR Code
uses: actions/upload-artifact@v3
with:
name: qr-code
path: repo-qr.png- Node.js 20.x or later
- npm
- Clone the repository
- Install dependencies:
npm install
- Build the action:
npm run bundle
- Run tests:
npm test
You can test the action locally using the @github/local-action utility:
npx @github/local-action . src/main.ts .envCreate a .env file with your test inputs:
INPUT_TEXT=https://example.com
INPUT_OUTPUT-PATH=test-qr.png
INPUT_WIDTH=256
INPUT_MARGIN=1
INPUT_TYPE=pngMIT