JamesIves / github-sponsors-readme-action

ā¤ļø This GitHub Action will automatically add your GitHub Sponsors to your README. It can be configured in multiple ways allowing you to display and breakdown your sponsors by price tier with fallbacks.
https://github.com/marketplace/actions/add-github-sponsors-to-readme
MIT License
74 stars 18 forks source link

bug: šŸ URLs are now incorrectly formatted in the generated README #824

Closed olimorris closed 2 months ago

olimorris commented 2 months ago

Describe the bug

Last night, I noticed that this action starts generating incorrect URLs.

Previously, I would see output in my README like:

<a href="https://github.com/mtmr0x"><img src="https://github.com/mtmr0x.png" width="60px" alt="Matheus Marsiglio" /></a><a href="https://github.com/unicell"><img src="https://github.com/unicell.png" width="60px" alt="Qiu Yu" /></a><a href="https://github.com/zhming0"><img src="https://github.com/zhming0.png" width="60px" alt="Zhiming Guo" /></a>

But as of last night, I see:

<a href="https://github.com/mtmr0x"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5414299?u&#x3D;b60f401c665a5aecd45bf4a5c79f7fced0e85b6d&amp;v&#x3D;4" width="60px" alt="Matheus Marsiglio" /></a><a href="https://github.com/unicell"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;35352?u&#x3D;1de708f9084ea3ea710294a38694414af4c6ed53&amp;v&#x3D;4" width="60px" alt="Qiu Yu" /></a><a href="https://github.com/zhming0"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1054703?u&#x3D;b173a2c1afc61fa25d9343704659630406e3dea7&amp;v&#x3D;4" width="60px" alt="Zhiming Guo" /></a>

Reproduction Steps

This arises from an action which I have running at 9pm every night

Logs

No response

Workflow

name: Update Sponsors in the README

on:
  workflow_dispatch:
  schedule:
    - cron: 0 21 * * 0-6

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout šŸ›Žļø
        uses: actions/checkout@v4

      - name: Generate Sponsors šŸ’–
        uses: JamesIves/github-sponsors-readme-action@v1
        with:
          token: ${{ secrets.SPONSORS_TOKEN }}
          file: "README.md"
        if: ${{ github.repository == 'olimorris/codecompanion.nvim' }}

      - name: Create Pull Request šŸš€
        uses: peter-evans/create-pull-request@v6
        with:
          commit-message: "docs: update sponsors in README.md"
          title: "Update Sponsors in README"
          labels: "ignore-for-release"
          delete-branch: true

Additional Comments

I note that it was working fine the previous night. A link to the PR it created for me.

JamesIves commented 2 months ago

I made a change yesterday that enables the usage of the fully qualified avatar url provided as part of the sponsorship entity object in the GitHub API for the default template. The avatars will still continue to display as you expect as the browser knows how to decode them, you can see what it looks like here: https://github.com/olimorris/codecompanion.nvim/tree/create-pull-request/patch - all of the fields you can populate in a template are encoded as a safety measure to prevent malformed content from automatically making their way into your project files.

This change was made to more gracefully enable the include-private feature as it allows the action to set a default avatar for private sponsors.

olimorris commented 2 months ago

Got it. Thanks so much