Skip to content

Bug report: Amount in commit logs is undefined #348

@romangrewal

Description

@romangrewal

Checks

Description

When updating recent activity, {AMOUNT} is undefined in commit push event.

Further investigation reveals that payload.size is not returned in the JSON data from actions-toolkit library.

Steps to reproduce

  1. Push code to a repository
  2. Execute github action to update README,md file
  3. Observe that push event reads "Pushed undefined commit(s) ..."
  4. In src/events/PushEvent.js, observe that {AMOUNT} is replaced by item.payload.size
  5. In src/index.js after line 30, log eventData to observe that payload.size is not returned in the JSON data from the actions-toolkit library.

Configuration

Workflow file:
name: Update README Activity
on:
  schedule:
    - cron: "*/30 * * * *" # Runs every 30 minutes
  workflow_dispatch: # Allows manual triggering

jobs:
  recent-activity:
    name: 'Update README with latest activity'
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout Repository'
        uses: actions/Checkout@v3
      - name: 'Update README.md with recent activity'
        uses: Readme-Workflows/recent-activity@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Recent Activity config file:
settings:
  username: "romangrewal" # Replace with your username or comment out this line
  commit_msg: "⚡ Update README with the recent activity"
  max_lines: 100
  whitelisted_events:
    - comments
    - create_repo
    - fork
    - issues
    - issues_open
    - issues_close
    - member
    - pr
    - pr_open
    - pr_merge
    - pr_close
    - push
    - release
    - review
    - star
    - wiki
  url_text: "{REPO}{ID}"
  commit_name: "readme-bot"
  commit_email: "41898282+github-actions[bot]@users.noreply.github.com"
  line_prefix: "{NUM}. "
messages:
  comments: "💬 Commented on {ID} in {REPO}"
  push: "⬆️ Pushed {AMOUNT} commit(s) to {REPO}"
  issue_opened: "❗️ Opened issue {ID} in {REPO}"
  issue_closed: "✔️ Closed issue {ID} in {REPO}"
  pr_opened: "💪 Opened PR {ID} in {REPO}"
  pr_closed: "❌ Closed PR {ID} in {REPO}"
  pr_merged: "🎉 Merged PR {ID} in {REPO}"
  create_repo: "📔 Created new repository {REPO}"
  fork_repo: "🔱 Forked {FORK} from {REPO}"
  wiki_create: "📖 Created new wiki page {WIKI} in {REPO}"
  added_member: "🤝 Became collaborator on {REPO}"
  changes_approved: "👍 Approved {ID} in {REPO}"
  changes_requested: "🔴 Requested changes in {ID} in {REPO}"
  new_release: "✌️ Released {ID} in {REPO}"
  new_star: "⭐ Starred {REPO}"

Expected behaviour

{AMOUNT} is replaced by commit count

Actual behaviour

{AMOUNT} is undefined

Failed runs

https://github.com/romangrewal/romangrewal/actions/runs/18661441352/job/53202631024

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions