Skip to content

feat/idea: automate achievement badges with GitHub Actions #18

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

Open
glaucia86 opened this issue Feb 19, 2025 · 0 comments
Open

feat/idea: automate achievement badges with GitHub Actions #18

glaucia86 opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@glaucia86
Copy link
Member

Related with #17


📌 Summary

To enhance engagement and interactivity in the repository, we can implement an automated badge system using GitHub Actions. This system will recognize contributors who complete the learning journey and award them achievement badges, displayed in a Hall of Fame inside the README.


🎯 Proposed Solution

1️⃣ Users Claim Their Badge via an Issue

  • Participants who complete the learning journey can open a new issue with the title:
    "[Badge Request] – @githubusername"

  • In the issue description, they will state which achievements they have completed.

2️⃣ GitHub Action Updates the README

  • A GitHub Action will detect new issues with the [Badge Request] prefix.

  • It will automatically append the contributor’s name and badge to the Hall of Fame section in the README.

3️⃣ Example: Hall of Fame Section in README

Once the GitHub Action runs, the README will be updated dynamically:

## 🏆 Hall of Fame – AI Journey Achievers  

- @user1 - 🎖 **Time Traveler**  
- @user2 - 🏆 **Lighthouse Architect**  
- @user3 - 🤖 **AI Whisperer**  

🛠 Implementation Steps

1️⃣ Create a GitHub Action Workflow

  • Add a new workflow file at .github/workflows/add-badge.yml

  • This workflow will:

    • Detect new issues with [Badge Request] in the title.
    • Extract the GitHub username.
    • Append the username and badge to the README file.
    • Commit the updated README back to the repository.

2️⃣ Example GitHub Action Workflow (add-badge.yml)

name: Add Achievement Badge
on:
  issues:
    types: [opened]

permissions:
  contents: write

jobs:
  update-readme:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Extract GitHub username
        run: |
          echo "- @${{ github.event.issue.user.login }} - 🏆 **Achievement Unlocked**" >> README.md

      - name: Commit and push changes
        run: |
          git config --global user.name 'github-actions[bot]'
          git config --global user.email 'github-actions@github.com'
          git add README.md
          git commit -m "Added @${{ github.event.issue.user.login }} to Hall of Fame"
          git push

✅ Expected Outcome

🔹 Users can claim their achievement badges easily.
🔹 Contributors get recognition in the repository.
🔹 Encourages engagement and participation.

@glaucia86 glaucia86 added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant