Skip to content

Write a script using puppeteer in a Github Actions workflow

License

Notifications You must be signed in to change notification settings

maku693/action-puppeteer-script

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puppeteer Script Action

This action enables to write a script using puppeteer in a Github Actions workflow.

This action is inspired from @actions/github-scripts action.

Example Usage

- id: get-title
  uses: maku693/action-puppeteer-script@v0
  with:
    script: |
      const page = await browser.newPage();
      await page.goto('https://example.com');
      const title = await page.$eval('title', el => el.textContent);
      return title;
- run: echo '${{ steps.get-title.outputs.result }}' # This will puts `"Example Domain"`

Inputs

script

Required The script to run.

This will be the body of the async function to execute.

The function receives browser argument which is an instance of puppeteer.Browser.

Outputs

result

The JSON-encoded return value of the script.

About

Write a script using puppeteer in a Github Actions workflow

Resources

License

Stars

Watchers

Forks