GithubHelp home page GithubHelp logo

pavi2410 / html-preview-action Goto Github PK

View Code? Open in Web Editor NEW
32.0 3.0 9.0 675 KB

GitHub action to preview HTML page

License: MIT License

JavaScript 100.00%
html preview github-actions html-preview

html-preview-action's Introduction

HTML Preview Action

This is a simple Github Action which comments on your PRs with a link to preview HTML files directly in the browser.

This is just a novelty action, but feel free to use it. If you'd like to contribute then just open a PR.

Usage

- name: HTML Preview
  id: html_preview
  uses: pavi2410/html-preview-action@v2
  with:
    html_file: 'index.html'

To get the url output, use this steps.html_preview.outputs.url in your later steps.

Credits

https://github.com/htmlpreview/htmlpreview.github.com

html-preview-action's People

Contributors

dependabot[bot] avatar pavi2410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

html-preview-action's Issues

Getting ##[error]Cannot read property 'number' of undefined

Hi, tried using your code for github actions via marketplace, getting the following error while trying to build and run my html. Have you encountered the same?

Run pavi2410/html-preview-action@v1a
with:
msg: Click here to preview HTML page in browser
html_file: docs/html/index.html
gh_token: ***

##[error]Cannot read property 'number' of undefined

404 Not Found

I am trying to use your tool to display my test result.
I like the PR comment functionality so I am using your v1a.
It passes the Publish test results step but then I get a 404 when clicking on the link:

image

Any pointers?

Here is my workflow:

env:
  PYTHON: /usr/bin/python3
  WORKING_DIR: /home/runner/work/surface-tmp/surface-tmp
  VENV: /home/runner/work/surface-tmp/surface-tmp/.env/bin
  PYSPARK_PYTHON: python3
  PYSPARK_DRIVER_PYTHON: python3

name: Surface

on:
  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master
      - name: Cache pip
        uses: actions/cache@v2
        with:
          path: ~/.cache/pip
          key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
          restore-keys: |
            ${{ runner.os }}-pip-
            ${{ runner.os }}-
      - name: Test
        run: |
          ${PYTHON} -m venv .env
          ${VENV}/pip install -r ${WORKING_DIR}/requirements.txt
          ${VENV}/python test_report.py --open_browser False
      - name: Publish test results
        id: html_preview
        uses: pavi2410/html-preview-action@v1a
        with:
          msg: 'Click here to open test result in browser'
          html_file: 'reports/surface-test-report.html'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.