As developers, we are constantly seeking for methods to demonstrate our abilities and accomplishments. TryHackMe provides an excellent forum for cybersecurity enthusiasts to learn and demonstrate their expertise. However, manually upgrading your TryHackMe badges can be tedious. That’s why I created the TryHackMe Badge Action Workflow, a GitHub Action that automates the process of displaying your TryHackMe achievements within your GitHub profile or repository.
In this blog article, I’ll explain why I created this action, how it works, and how you may use it in your own markdown files in github.
TryHackMe is a tool that many people in the cybersecurity field use to sharpen their abilities. However, manually updating badges or tracking your progress might be time-consuming, especially if you want to share this information on your GitHub page. I thought of a solution that would automate this process, allowing anyone to demonstrate their TryHackMe achievements with no effort.
The TryHackMe Badge Action Workflow is a custom GitHub Action that refreshes and displays your TryHackMe badge on your GitHub profile or repository README page. This action allows you to maintain your achievements up to date without having to manually download, update, or commit your badge picture each time you acquire a new one.
This action updates your GitHub profile or repository README with the new image and retrieves your most recent TryHackMe badge. This is a summary of the workflow’s functions:
Add the below script to your GitHub repository as a .yml file (e.g., update-tryhackme-badge.yml).
Configure the action with the following inputs:
GITHUB_TOKEN: Your GitHub Personal Access Token (required, set as a secret).
image_path: The path to store the downloaded badge image (defaults to ./assets/tryhackme-badge.png).
username: Your TryHackMe username (defaults to the value in a secret named THM_USERNAME).
user_id: Your TryHackMe user ID (defaults to the value in a secret named THM_USER_ID).
name: Update TryHackMe Badge
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight
workflow_dispatch: # Allows manual triggering
jobs:
update-badge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch TryHackMe Badge
uses: DhanushNehru/[email protected]
with:
image_path: './assets/tryhackme-badge.png'
username: 'your_tryhackme_username'
user_id: 'your_tryhackme_user_id'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
An easy-to-use yet effective solution for automating the display of your security accomplishments is the TryHackMe Badge Action Workflow.
If you liked the project as a source of encouragement and support please give it a star ⭐️👇
I have used this in my Github README.md so feel free to check it out
Thanks for reading, please give a like as a sort of encouragement and also share this post in socials to show your extended support.
Connect ⬇️