Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[ BUG ] Wrong filename in Github Action (the trailing ".md" should be removed)

未关闭
#113 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
github-actions, markdown, shell
领域
ci-cd, tooling

调研方向

Start with the gh-md-toc script downloaded and invoked by the workflow, using the reported server.md example as the reproduction. Check how links are generated for headings in wiki files and verify that the output uses only the heading anchor, without the .md filename, while remaining suitable for the generated site.

由索引模型根据 Issue 内容生成。

描述

bug

To start with: thank you for this great Markdown enhancement!

Describe the bug
I added a github action in the graphql-maven-plugin-project'wiki.
The issue is that the URL in the generated TOC doesn't work.

You can check on this file

https://github.com/graphql-java-generator/graphql-maven-plugin-project/wiki/server.md#graphql-maven-plugin-server-mode-usage

Expected behavior

The generated link is:

   * [GraphQL Maven Plugin (server mode usage)](server.md#graphql-maven-plugin-server-mode-usage)

But it should be:

   * [GraphQL Maven Plugin (server mode usage)](#graphql-maven-plugin-server-mode-usage)

Without the filename at all. This insures that the link will work:

  • In the github wiki (where the URL is https://github.com/graphql-java-generator/graphql-maven-plugin-project/wiki/server)
  • In the site generated by maven (where the URL is https://graphql-maven-plugin-project.graphql-java-generator.com/server.html)
    • The filename ends with .html here

Perhaps there is a parameter to manage that, but I did not find it.

Environment (please complete the following information):
I'm execution the github action with this action file:

# This is a basic workflow to help you get started with Actions

name: Wiki TOC

# Controls when the action will run. 
on:
  # Triggers the workflow on any change on the wiki (on the master branch)
  #gollum:    # This is triggered each time a file is changed on the wiki, including when the this script automatically run!
  
  # Below: push on the wiki, for the master branch 
  #push:
  #  paths:
  #    - 'wiki/**'
  #  branches:
  #    - master

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "toc"
  toc:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - uses: actions/checkout@v2
        with:
          repository: ${{github.repository}}.wiki
      - run: |
          ls
          curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o gh-md-toc
          chmod a+x gh-md-toc
          ./gh-md-toc --insert --no-backup *.md
      - uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: Auto update markdown TOC
主要语言
Shell
星标
3.3k
派生
2.7k
平均合并
2 分钟
30 天内合并 PR
1

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ekalinin/github-markdown-toc 的其他 Issue

查看 ekalinin/github-markdown-toc 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。