Skip to content
layout

GitHub Action

Comic Strip Readme

v1.2 Latest version

Comic Strip Readme

layout

Comic Strip Readme

Add the xkcd comic strip to your Readme

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Comic Strip Readme

uses: ism0080/comicstrip-readme@v1.2

Learn more about this action in ism0080/comicstrip-readme

Choose a version

Comic Strip Build

This GitHub Workflow updates your readme with the provided comic strips daily. The current comics available are:

Update your README

Add a comment to your README.md:

<!--START_SECTION:comicstrip-->
<!--END_SECTION:comicstrip-->

The images will appear between the comments

Profile Repository

If you're executing the workflow on your Profile Repository (<username>/<username>)

You wouldn't need an GitHub Access Token since GitHub Actions already makes one for you.

Follow the bellow steps:

  1. Go to your <username>/<username>/actions, hit New workflow, set up a workflow yourself, delete all the default content github made for you.
  2. Copy the following code and paste it to your new workflow you created at step 1:
name: Comic Strip Readme

on:
    workflow_dispatch:
    schedule:
        # Runs at 8am UTC every Monday, Wednesday, Friday
        - cron: "0 8 * * 1,3,5"

jobs:
    update-readme:
        name: Update README with Comic Strip
        runs-on: ubuntu-latest
        steps:
            - uses: ism0080/comicstrip-readme@v1.2
              with:
                  SHOW_XKCD: true

This will add the XKCD comics to your README.md at 8am UTC every Monday, Wednesday and Friday

  1. Add a comment to your README.md like this:
<!--START_SECTION:comicstrip-->
<!--END_SECTION:comicstrip-->
  1. Go to Workflows menu (mentioned in step 1), click Comic Strip Readme, click Run workflow.

  2. Go to your profile page. you will be able to see it.

Other Repository (not Profile)

If you're executing the workflow on another repo other than <username>/<username>

You'll need to get a GitHub Access Token with a repo scope and save it in the Repo Secrets GH_TOKEN = <Your GitHub Access Token>

Here is Sample Workflow File for running it:

name: Comic Strip Readme

on:
    schedule:
        # Runs at 8am UTC every Monday, Wednesday, Friday
        - cron: "0 8 * * 1,3,5"

jobs:
    update-readme:
        name: Update README with Comic Strip
        runs-on: ubuntu-latest
        steps:
            - uses: ism0080/comicstrip-readme@v1.2
              with:
                  SHOW_XKCD: true
                  GH_TOKEN: ${{ secrets.GH_TOKEN }}
                  REPOSITORY: <username/username> # optional, By default, it will automatically use the repository who's executing the workflow.

Extras

  1. You can specify a commit message to override the default "Updated readme comic strip". Add COMMIT_MESSAGE with the commit message you want
with:
    COMMIT_MESSAGE: Readme updated

NOTE: Sometimes the comic may not be new at the time of the cron job running