Skip to content

QR Code Generator Action

Actions
Generate a QR code image file from text
v0.2.2
Latest
Star (0)

QR Code Generator Action

A GitHub Action to generate QR code images from text or URLs.

Features

  • Generate QR codes as PNG or SVG images
  • Customizable width and margin

Usage

Basic Example

steps:
  - name: Generate QR Code
    uses: VeyronSakai/[email protected]
    with:
      text: 'https://github.com/VeyronSakai/qr-code-generator'
      output-path: 'qrcode.png'

Inputs

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

Examples

Generate QR Code and Upload as Artifact

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

Development

Prerequisites

  • Node.js 20.x or later
  • npm

Setup

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Build the action:
    npm run bundle
  4. Run tests:
    npm test

Local Testing

You can test the action locally using the @github/local-action utility:

npx @github/local-action . src/main.ts .env

Create 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=png

License

MIT

QR Code Generator Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Generate a QR code image file from text
v0.2.2
Latest

QR Code Generator Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.