Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/file filter #7

Merged
merged 17 commits into from
Feb 2, 2022
70 changes: 64 additions & 6 deletions .github/workflows/gource-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,38 @@ on:
- 'dev/**'

jobs:
dev-action:
local-images:
runs-on: ubuntu-latest

steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 'Current folder'
run: ls -al

- name: 'Gource Action'
uses: ./
with:
git_url: ./
avatars_url: ./avatars/
gource_title: 'Gource Action Development'
logo_url: ./logo.png

- name: 'Check output'
run: |
ls -al ./
ls -al ./gource

- uses: actions/upload-artifact@v2
with:
name: gource-local
path: ./gource
retention-days: 1

external-images:
runs-on: ubuntu-latest

steps:
Expand All @@ -25,10 +56,6 @@ jobs:
avatars_url: ./avatars/
gource_title: 'Gource Action Development'
logo_url: 'https://user-images.githubusercontent.com/24683383/92398226-79a40680-f128-11ea-9f54-6ccbaca4a6a5.png'
gource_resolution: '1080p'
gource_fps: 60
gource_font_size: 40
gource_file_filter: ^.+\.(png|md)$

- name: 'Check output'
run: |
Expand All @@ -37,5 +64,36 @@ jobs:

- uses: actions/upload-artifact@v2
with:
name: gource
name: gource-external
path: ./gource
retention-days: 1

no-images:
runs-on: ubuntu-latest

steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 'Current folder'
run: ls -al

- name: 'Gource Action'
uses: ./
with:
git_url: ./
avatars_url: ./avatars/
gource_title: 'Gource Action Development'

- name: 'Check output'
run: |
ls -al ./
ls -al ./gource

- uses: actions/upload-artifact@v2
with:
name: gource-no
path: ./gource
retention-days: 1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Keys can be added directly to your .yml config file or referenced from your proj
|--------------------------- |----------- |---------------------- |------------------------------------------------------------------------------------------------------------ |
| git_url | false | ./ | Location of git repository. Can also be an remote repository e.g.: https://github.com/acaudwell/Gource.git |
| git_token | false | | If the provided repository is private, the action need an token with read scope. |
| logo_url | false | | Displayed icon on bottom right corner. |
| logo_url | false | | Displayed icon on bottom right corner. Can be local "./logo.png" or Url. For Url it must be png or jgp |
| avatars_url | false | | Path of local directory containing user avatars. |
| gource_resolution | false | 1080p | Used gource resolution (2160p, 1440p, 1080p, 720p). |

Expand Down Expand Up @@ -150,4 +150,4 @@ A full list of all available options can be found [here][gource-docs].
<!-- Links -->
[docker-cli]: https://github.com/docker/cli
[gource-homepage]: https://gource.io/
[gource-docs]: https://github.com/acaudwell/Gource/blob/master/README
[gource-docs]: https://github.com/acaudwell/Gource/blob/master/README.md
13 changes: 9 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@ fi

# Set proper env variables if we have a logo.
printf "\n>\n> Logo check"
if [ "${INPUT_LOGO_URL}" != "" ]; then
# // TODO: Add support for local logo
printf "\n> \tDownloading logo"
wget -O ./logo.image ${INPUT_LOGO_URL} >/dev/null 2>&1
if [ "$INPUT_LOGO_URL" != "" ]; then
if [[ $INPUT_LOGO_URL =~ ^https?:\/\/.+(png|jpg)$ ]]; then
printf "\n> \tDownloading file"
wget -O ./logo.image $INPUT_LOGO_URL >/dev/null 2>&1
else
printf "\n> \tUsing local file"
mv "./git_repo/$INPUT_LOGO_URL" ./logo.image
fi

convert -geometry x160 ./logo.image ./logo.image

printf "\n> \tUsing logo from: ${INPUT_LOGO_URL} \n"
Expand Down
4 changes: 3 additions & 1 deletion gource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ fi
if [[ $INPUT_GOURCE_START_DATE == *[!\ ]* ]]; then # Temporyry fix, check if it's a date
OPTIONAL_PARAMS+="--start-date ${INPUT_GOURCE_START_DATE} "
fi
if [[ -z "$INPUT_GOURCE_FILE_FILTER" ]]; then
OPTIONAL_PARAMS+="--file-filter \"$INPUT_GOURCE_FILE_FILTER\" "
fi

printf "\n> \t\tUsing optional params: ${OPTIONAL_PARAMS}"

Expand All @@ -85,7 +88,6 @@ gource --seconds-per-day ${INPUT_GOURCE_SECONDS_PER_DAY} \
--font-size ${INPUT_GOURCE_FONT_SIZE} \
--dir-name-depth ${INPUT_GOURCE_DIR_DEPTH} \
--filename-time ${INPUT_GOURCE_FILENAME_TIME} \
--file-filter "${INPUT_GOURCE_FILE_FILTER}" \
--max-user-speed ${INPUT_GOURCE_MAX_USER_SPEED} \
--bloom-multiplier 1.2 \
--${GOURCE_RES} ${OPTIONAL_PARAMS} \
Expand Down
30 changes: 0 additions & 30 deletions helper.sh

This file was deleted.

Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.