Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create Starline for arnaudcharles/psbite #8349

Create Starline for arnaudcharles/psbite

Create Starline for arnaudcharles/psbite #8349

name: Create Starline
run-name: "Create Starline for ${{ github.event.inputs.resource }}"
on:
workflow_dispatch:
inputs:
resource:
required: true
concurrency:
group: ${{ github.event.inputs.resource }}
cancel-in-progress: false
jobs:
create-starline:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Validate inputs
uses: actions/github-script@v7
with:
result-encoding: string
retries: 3
script: |
if(process.env.INPUT_RESOURCE?.match(/\s+/)) {
core.failure(`inputs.resource must not contain whitespaces, but was'${process.env.INPUT_RESOURCE}'`)
}
env:
INPUT_RESOURCE: "${{ github.event.inputs.resource }}"
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Add starline to step summary
run: |
if [[ ! "$ASSET" == *"/"* ]]; then
echo "[$ASSET](https://github.com/$ASSET)" >> $GITHUB_STEP_SUMMARY
elif [[ "$ASSET" == *@gist ]]; then
echo "[$ASSET](https://gist.github.com/${ASSET%@gist})" >> $GITHUB_STEP_SUMMARY
else
echo "[$ASSET](https://github.com/$ASSET)" >> $GITHUB_STEP_SUMMARY
fi
env:
ASSET: ${{ github.event.inputs.resource }}
- run: node create-starline.js ${{ github.event.inputs.resource }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIST_GITHUB_TOKEN: ${{ secrets.GIST_GITHUB_TOKEN }}
- name: Add starline to step summary
run: |
echo "[![starline](https://starlines.qoo.monster/assets/$ASSET)](https://github.com/qoomon/starlines/releases/download/starlines/$(echo "$ASSET" | sed 's/[\/@]/--/g')--starline.svg)" >> $GITHUB_STEP_SUMMARY
env:
ASSET: ${{ github.event.inputs.resource }}
- uses: actions/upload-artifact@v4
with:
path: starlines/${{ github.event.inputs.resource }}/starline.svg