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

Markdown Table output is "off" #176

Closed
sysadmiral opened this issue Jul 8, 2024 · 5 comments · Fixed by #177
Closed

Markdown Table output is "off" #176

sysadmiral opened this issue Jul 8, 2024 · 5 comments · Fixed by #177
Assignees
Labels
bug Something isn't working

Comments

@sysadmiral
Copy link

sysadmiral commented Jul 8, 2024

Describe the bug

The produced markdown table has the normal separators on line 2 but the output isn't quite right and so the markdown doesn't render.

This is the outputted column headers and the separators on line 2:

| Repository URL | Days Inactive | Last Push Date | Visibility | Days Since Last Release | Days Since Last PR |
| --- | --- | --- | ---: | ---: |

There are only five columns in line 2 which is less than the six column headers and there are some unecessary colons in the output.

To Reproduce

Not sure. I've setup the workflow to pass the output to the create-issue-from-file action so I'm hoping the output isn't being altered somehow.

Here is my redacted workflow:

on:
  workflow_dispatch:
  schedule:
    - cron:  '30 5 * * 4' # 0530 on a thursday

name: Run the stale-repos report

permissions:
    contents: read

jobs:
  build:
    name: stale repo identifier
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

    - name: Run stale_repos tool
      uses: github/stale-repos@ba84f4865211804e46c78d401815ae722ce6a498 # v1
      env:
        GH_APP_ID: ${{ secrets.APP_ID }}
        GH_APP_INSTALLATION_ID: ${{ secrets.APP_INSTALLATION_ID }}
        GH_APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
        ORGANIZATION: ${{ secrets.ORGANIZATION }}
        INACTIVE_DAYS: 180
        ACTIVITY_METHOD: "pushed"
        ADDITIONAL_METRICS: "release,pr"

    - name: Generate a token
      id: generate-token
      uses: actions/create-github-app-token@ad38cffc07bac6e3857755914c4c88bfd2db4da4 # v1
      with:
        app-id: ${{ secrets.APP_ID }}
        private-key: ${{ secrets.APP_PRIVATE_KEY }}

    - name: Check for the stale report issue
      run: |
        ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number")
        echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV"
      env:
        GH_TOKEN: ${{ steps.generate-token.outputs.token }}

    - name: Create issue
      uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5
      with:
        issue-number: ${{ env.issue_number }}
        title: Stale repository report
        content-filepath: ./stale_repos.md
        token: ${{ steps.generate-token.outputs.token }}

Expected behavior

The columns in the markdown are the same number on each row.

Screenshots

No response

Additional context

No response

@sysadmiral sysadmiral added the bug Something isn't working label Jul 8, 2024
@sysadmiral
Copy link
Author

Some additional checking I did was to upload the produced md file as an artifact and after downloading I can confirm that the issue is in the produced output and nothing is altering the file after the fact.

@zkoppert zkoppert self-assigned this Jul 8, 2024
@zkoppert
Copy link
Member

zkoppert commented Jul 8, 2024

Thanks for opening this and confirming that things aren't being altered afterward. I'll take a look at this. 👀

@zkoppert
Copy link
Member

zkoppert commented Jul 8, 2024

@sysadmiral Please let me know if this has corrected things for your specific configuration or not. Testing in this area isn't as comprehensive as I'd like. I'll get back to fixing that part later.

@sysadmiral
Copy link
Author

Will test as soon as a new version gets published and renovatebot updates our actions. Thanks for the quick fix!

@zkoppert
Copy link
Member

Creating a release today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants