Skip to content

Commit

Permalink
Merge pull request #6 from actions/pages/future
Browse files Browse the repository at this point in the history
Add --future support and + add a shellcheck
  • Loading branch information
Yoann Chaudet authored and GitHub committed Dec 27, 2021
2 parents 6379b98 + 006a9c2 commit a8e1e47
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'ShellCheck'

on:
pull_request:
paths:
- '**.sh'

jobs:
shellcheck:
runs-on: ubuntu-latest
env:
SHELLCHECK_OPTS: -s bash
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
with:
version: v0.8.0
format: tty
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# Manage our dependency on the version of the github-pages gem here.
gem "github-pages", "= 222"
gem "github-pages", "= 223"

# Explicitly include this gem here.
# It is not directly included in the github-pages gem list of dependencies,
Expand Down
10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 2f9877141f775a9030dcf59ab535e186
# Generated from action.yml.erb
# cc3ed5559aaeabbc7ccc9899f91995ca
name: 'Pages Jekyll'
description: 'A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages'
inputs:
Expand All @@ -10,15 +11,18 @@ inputs:
description: 'Output directory of the build. Although it can be nested inside the source, it cannot be the same as the source directory.'
required: false
default: ./_site
future:
description: 'Publishes posts with a future date.'
required: false
default: true
verbose:
description: 'Verbose output'
required: false
default: '1'
default: true
token:
description: 'GitHub token'
required: true
default: ${{ github.token }}
runs:
using: 'docker'
image: 'docker://ghcr.io/actions/jekyll-build-pages:main'

8 changes: 6 additions & 2 deletions action.yml.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated from action.yml.erb
# <%= nonce %>
name: 'Pages Jekyll'
description: 'A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages'
Expand All @@ -10,15 +11,18 @@ inputs:
description: 'Output directory of the build. Although it can be nested inside the source, it cannot be the same as the source directory.'
required: false
default: ./_site
future:
description: 'Publishes posts with a future date.'
required: false
default: true
verbose:
description: 'Verbose output'
required: false
default: '1'
default: true
token:
description: 'GitHub token'
required: true
default: ${{ github.token }}
runs:
using: 'docker'
image: '<%= pages_action_url %>'

17 changes: 12 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ export JEKYLL_ENV="production"
export JEKYLL_GITHUB_TOKEN=$INPUT_TOKEN
export PAGES_REPO_NWO=$GITHUB_REPOSITORY

if [ -z $INPUT_VERBOSE ]; then
VERBOSE=''
else
# Set verbose flag
if [ "$INPUT_VERBOSE" = 'true' ]; then
VERBOSE='--verbose'
else
VERBOSE=''
fi

cd $PAGES_GEM_HOME
# Set future flag
if [ "$INPUT_FUTURE" = 'true' ]; then
FUTURE='--future'
else
FUTURE=''
fi

$GITHUB_PAGES build $VERBOSE --source $SOURCE_DIRECTORY --destination $DESTINATION_DIRECTORY
cd "$PAGES_GEM_HOME"
$GITHUB_PAGES build "$VERBOSE" "$FUTURE" --source "$SOURCE_DIRECTORY" --destination "$DESTINATION_DIRECTORY"

0 comments on commit a8e1e47

Please sign in to comment.