Add required branding

This commit is contained in:
Greyscale 2024-05-18 17:45:50 +02:00
parent de820cbde5
commit 3e1587aca0

View file

@ -1,5 +1,8 @@
name: "Get DateTime" name: "Get DateTime"
description: "Get the current date and time in a specific format." description: "Get the current date and time in a specific format."
branding:
color: "orange"
icon: "clock"
runs: runs:
using: "composite" using: "composite"
@ -7,13 +10,18 @@ runs:
- id: date - id: date
shell: bash shell: bash
run: | run: |
{ for var in datetime date time atom atom_with_millis; do
echo "datetime=$(date +'%Y-%m-%d %H:%M:%S')" value=$(date +'%Y-%m-%d %H:%M:%S')
echo "date=$(date +'%Y-%m-%d')" case $var in
echo "time=$(date +'%H:%M:%S')" datetime) value=$(date +'%Y-%m-%d %H:%M:%S') ;;
echo "atom=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" date) value=$(date +'%Y-%m-%d') ;;
echo "atom_with_millis=$(date -u +'%Y-%m-%dT%H:%M:%S.%3NZ')" time) value=$(date +'%H:%M:%S') ;;
} | tee -a "$GITHUB_OUTPUT" >> "$GITHUB_ENV" atom) value=$(date -u +'%Y-%m-%dT%H:%M:%SZ') ;;
atom_with_millis) value=$(date -u +'%Y-%m-%dT%H:%M:%S.%3NZ') ;;
esac
echo "$var=$value" | tee -a "$GITHUB_OUTPUT"
echo "${var^^}=$value" >> "$GITHUB_ENV"
done
outputs: outputs:
datetime: datetime:
description: "Current date and time in 'YYYY-MM-DD HH:MM:SS' format" description: "Current date and time in 'YYYY-MM-DD HH:MM:SS' format"