Skip to content

Commit

Permalink
test byob.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusef Almamari committed Sep 5, 2024
1 parent 15adbd0 commit fe44011
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 58 deletions.
81 changes: 25 additions & 56 deletions .github/workflows/byob.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,34 @@
name: Create Badge
name: BYOB

on:
push:
branches: [main]
schedule:
- cron: "*/5 * * * *"

jobs:
create-badge:
badge_job:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
- name: Bring Your Own Badge
uses: RubbaBoy/[email protected]
with:
python-version: "3.x"

- name: Install dependencies
NAME: contributions-welcome
LABEL: "Contributions Welcome"
ICON: "github"
STATUS: "Contributions welcome"
COLOR: green
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Read LICENSE file
id: license
run: |
python -m pip install --upgrade pip
pip install shields.io
- name: Generate badge
run: |
import os
from shields.io import Badge
# Get license content
with open('.gitattributes') as f:
license_content = f.read()
# Create static badge
static_badge = Badge(
label="Contributions welcome",
message="Contributions welcome!",
color="green"
)
echo "::set-env name=LICENSE_CONTENT::$(cat ${GITHUB_WORKSPACE}/LICENSE)"
# Create dynamic badge
dynamic_badge = Badge(
label="License",
message=license_content,
color="blue"
)
# Save badges as SVG files
static_badge.save("static_badge.svg")
dynamic_badge.save("dynamic_badge.svg")
- name: Update README.md
run: |
echo "# License\n\n$(cat .gitattributes)" >> README.md
echo "\n[![Static Badge](static_badge.svg)](https://github.com/discontinuedlabs/citeease/blob/main/static_badge.svg)" >> README.md
echo "\n[![Dynamic Badge](dynamic_badge.svg)](https://github.com/discontinuedlabs/citeease/blob/main/dynamic_badge.svg)" >> README.md
- name: Commit changes
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update README with badge"
git push
- name: Bring Your Own Badge
uses: RubbaBoy/[email protected]
with:
NAME: license
LABEL: "License"
ICON: "license"
STATUS: ${{ env.LICENSE_CONTENT | truncate:50 }}
COLOR: blue
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[![Lint](https://github.com/discontinuedlabs/citeease/actions/workflows/lint.yml/badge.svg)](https://github.com/discontinuedlabs/citeease/actions/workflows/lint.yml)
![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)
![License](https://img.shields.io/github/license/discontinuedlabs/citeease)
[![Static Badge](https://github.com/discontinuedlabs/citeease/actions/workflows/byob.yml/static_badge.svg)](https://github.com/discontinuedlabs/citeease/actions/workflows/byob.yml)
[![Dynamic Badge](https://github.com/discontinuedlabs/citeease/actions/workflows/byob.yml/dynamic_badge.svg)](https://github.com/discontinuedlabs/citeease/actions/workflows/byob.yml)
![Contributions Welcome](https://byob.yarr.is/discontinuedlabs/citeease/contributions-welcome)
![License](https://byob.yarr.is/discontinuedlabs/citeease/license)

**Welcome to CiteEase, an open-source Progressive Web App (PWA) for managing citations and collaborating on bibliographies.**

Expand Down

0 comments on commit fe44011

Please sign in to comment.