Skip to content

Enhancement proposal: dry run / test mode #451

@vincerubinetti

Description

@vincerubinetti

npm-publish has a nice feature called --dry-run that lets you test what the command is going to do without actually doing it. It might be nice to have something like that in actions-gh-pages.

It could look like this:

name: ci
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  ci:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code # blah blah blah
      - name: Set up Node # blah blah blah
      - name: Install packages # blah blah blah
      - name: Build app # blah blah blah
      - name: Test deploy
        uses: peaceiris/actions-gh-pages@v3
        if: github.event_name == 'pull_request' # on pull request
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          dry_run: true
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        if: github.event_name == 'push' # on push to master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

That way, on each pull request, I can see if this actions-gh-pages step in the CI workflow throws any errors, and I can get a list of what would've been published to the gh-pages branch (and any other helpful info). This would give me confidence that it will work fine when pushing/merging into master.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions