forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created lighthouse badger GitHub action
Signed-off-by: George Araújo <[email protected]>
- Loading branch information
1 parent
c5c6316
commit 3c2df19
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Lighthouse-Badger-Easy | GitHub Action Workflow | ||
# | ||
# Description: Generates, adds & updates manually/automatically Lighthouse badges & reports from one/multiple input URL(s) to the current repository & main branch with minimal settings | ||
# Author: Sitdisch | ||
# Source: https://github.com/myactionway/lighthouse-badger-workflows | ||
# License: MIT | ||
# Copyright (c) 2021 Sitdisch | ||
|
||
name: 'Lighthouse-Badger-Easy' | ||
|
||
######################################################################## | ||
# DEFINE YOUR INPUTS AND TRIGGERS IN THE FOLLOWING | ||
######################################################################## | ||
|
||
# INPUTS as environmental variables (env) for not manually triggered workflows | ||
env: | ||
URLS: # URL(s) to be checked e.g. 'https://github.com/sitdisch https://github.com/mythemeway' | ||
TOKEN_NAME: # target token name; insert only the name never the real value e.g. 'LIGHTHOUSE_BADGER_TOKEN' | ||
# THAT'S IT; JUMP TO THE TRIGGERS; | ||
REPO_BRANCH: '${{ github.repository }} main' # target repo & branch | ||
|
||
# TRIGGERS | ||
on: | ||
# page_build: | ||
# schedule: # Check your schedule here => https://crontab.guru/ | ||
# - cron: '55 23 * * 0' # e.g. every Sunday at 23:55 | ||
# | ||
# THAT'S IT; YOU'RE DONE; | ||
workflow_dispatch: | ||
inputs: | ||
urls: | ||
description: 'URL(s) to be checked' | ||
required: true | ||
token_name: | ||
description: 'Target token name (NO VALUE!)' | ||
required: true | ||
|
||
######################################################################## | ||
# THAT'S IT; YOU DON'T HAVE TO DEFINE ANYTHING IN THE FOLLOWING | ||
######################################################################## | ||
|
||
jobs: | ||
lighthouse-badger-easy: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 8 | ||
steps: | ||
- name: Preparatory Tasks | ||
run: | | ||
REPOSITORY=`expr "${{ env.REPO_BRANCH }}" : "\([^ ]*\)"` | ||
BRANCH=`expr "${{ env.REPO_BRANCH }}" : ".* \([^ ]*\)"` | ||
echo "REPOSITORY=$REPOSITORY" >> $GITHUB_ENV | ||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.REPOSITORY }} | ||
token: ${{ secrets[github.event.inputs.token_name] || secrets[env.TOKEN_NAME] }} | ||
ref: ${{ env.BRANCH }} | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: 'myactionway/lighthouse-badges' | ||
path: temp_lighthouse_badges_nested | ||
- uses: myactionway/[email protected] | ||
with: | ||
urls: ${{ github.event.inputs.urls || env.URLS }} |