Skip to content
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

FEAT: Add Symbol style customized by the user (Help with PR) #490

Closed
caupolicanre opened this issue Dec 3, 2023 · 3 comments
Closed

FEAT: Add Symbol style customized by the user (Help with PR) #490

caupolicanre opened this issue Dec 3, 2023 · 3 comments

Comments

@caupolicanre
Copy link

Hi, I requested a new symbol to be added in #489, then I wanted to be able to enter any type of symbol in the yml workflow file.
I'm trying to improve the symbol logic, but I keep getting the same error.

First I tried the same logic as the action shows, and did the same as shown in #471, but when I run the action, I receive the same KeyError.

Then I tried using waka-readme logic for handling symbols entered by the user with an enviroment variable. With this implementation, the action works fine, but nothing changes.

I modified the function "make_graph" and using the previous enviroment variable mentioned, check, if it's empty, use "Symbol" class, but if it is not, use the symbol entered by the user.

This is the workflow file:

name: Commits Readme

on:
  workflow_dispatch: # Manual workflow trigger
  schedule:
    - cron: "0 */6 * * *" # Updates every 6 hours

jobs:
  update-readme-commits:
    name: GitHub Commits
    runs-on: ubuntu-latest
    steps:
      - uses: caupolicanre/waka-readme-stats@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}

          # Config
          SECTION_NAME: commits
          SHOW_UPDATED_DATE: false

          # Content
          SHOW_LINES_OF_CODE: false
          SHOW_TOTAL_CODE_TIME: false
          SHOW_PROFILE_VIEWS: false
          SHOW_COMMIT: true
          # SYMBOL_VERSION: 1
          SYMBOL_STYLE: ▰▱
          SHOW_DAYS_OF_WEEK: false
          SHOW_LANGUAGE: false
          SHOW_OS: false
          SHOW_PROJECTS: false # Investigate to replicate languages format to show projects programming time
          SHOW_TIMEZONE: false
          SHOW_EDITORS: false
          SHOW_LANGUAGE_PER_REPO: false
          SHOW_SHORT_INFO: false
          SHOW_LOC_CHART: false          

          # Commit
          COMMIT_BY_ME: false
          COMMIT_USERNAME: GitHubActionBot
          COMMIT_EMAIL: action-bot@github.com

In this 2 commits are the modifications I made:
make_graph function logic
enviroment variable

@oHTGo
Copy link
Contributor

oHTGo commented Dec 3, 2023

Hi @caupolicanre, the GH actions may run by Docker image. Please add a debug log to check.
image
image

@caupolicanre
Copy link
Author

caupolicanre commented Dec 3, 2023

Hi @caupolicanre, the GH actions may run by Docker image. Please add a debug log to check. image image

@oHTGo The debug log you mention is done by using the "DEBUG_LOGGING" enviroment variable in the yml workflow file? or is it a configuration in Docker? I have very little experience working with docker.

I just tried enabling DEBUG_LOGGING in the workflow file, here is the job with the debug messages.

Should I modify "action.yml" file?

@caupolicanre
Copy link
Author

I just fixed. The problem was that the action.yml file was using:

runs:
   using: 'docker'
   image: 'docker://wakareadmestats/waka-readme-stats:master'

I modified it to run and test my action with "Dockerfile" file located in root repository:

runs:
  using: "docker"
  image: "Dockerfile"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants