Skip to content

Commit

Permalink
Run action without Docker
Browse files Browse the repository at this point in the history
Move to composite action as described in
https://dev.to/github/build-your-own-github-action-without-a-docker-container-1eic.
The goal is to improve runtime by avoiding to build a Docker image.

Closes #121
  • Loading branch information
mre authored May 29, 2022
1 parent 099d823 commit 7de5ee7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 34 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on:
on:
- repository_dispatch
- workflow_dispatch
- push
Expand All @@ -14,14 +14,14 @@ jobs:
# we must check out the repository
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
# `lycheeverse/lychee-action@...` gets classified as an e-mail address,
# causing this test to fail.
# TODO: Reactive once this issue is fixed upstream:
# https://github.com/robinst/linkify/issues/29
#- name: test defaults
# uses: ./
# with:
# fail: true
- name: test defaults
uses: ./
with:
fail: true
- name: test explicit lychee version
uses: ./
with:
lycheeVersion: 0.9.0
- name: test globs
uses: ./
with:
Expand Down
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ See [lychee's documentation][lychee-args] for all possible arguments.

On top of that, the action also supports some additional arguments.

| Argument | Description |
| ---------- | -------------------------------------------------------------------------------- |
| format | Summary output format (markdown, json,...) |
| output | Summary output file path |
| fail | Fail entire pipeline on error (i.e. when lychee exit code is not 0) |
| jobSummary | Write Github job summary at the end of the job (written on Markdown output only) |
| Argument | Description |
| ------------- | -------------------------------------------------------------------------------- |
| format | Summary output format (markdown, json,...) |
| output | Summary output file path |
| fail | Fail entire pipeline on error (i.e. when lychee exit code is not 0) |
| jobSummary | Write Github job summary at the end of the job (written on Markdown output only) |
| lycheeVersion | Overwrite the lychee version to be used |

See [action.yml](./action.yml) for a full list of supported arguments.

Expand Down
26 changes: 24 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,31 @@ inputs:
description: "write Github job summary at the end of the job (written on Markdown output only)"
default: true
required: false
lycheeVersion:
description: "use custom version of lychee link checker"
default: 0.9.0
required: false
runs:
using: "docker"
image: "Dockerfile"
using: "composite"
steps:
- name: install lychee
run: |
curl -LO 'https://github.com/lycheeverse/lychee/releases/download/v${{ inputs.LYCHEEVERSION }}/lychee-v${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz'
tar -xvzf lychee-v${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz
chmod 755 lychee
mv lychee /usr/local/bin/lychee
shell: bash
- run: ${{ github.action_path }}/entrypoint.sh
env:
#https://github.com/actions/runner/issues/665
INPUT_GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
INPUT_ARGS: ${{ inputs.ARGS }}
INPUT_FORMAT: ${{ inputs.FORMAT }}
INPUT_OUTPUT: ${{ inputs.OUTPUT }}
INPUT_FAIL: ${{ inputs.FAIL }}
INPUT_JOBSUMMARY: ${{ inputs.JOBSUMMARY }}
shell: bash

branding:
icon: "external-link"
color: "purple"

0 comments on commit 7de5ee7

Please sign in to comment.