question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A github actions example to extract issues of the repo itself

See original GitHub issue

Thank you for your great work.

I add my github actions example here, in case someone needs it.

it backups all issues every day.

Because it only backup the issues belong to the repository that contains this workflow. It does not limit by the GitHub API rate.

# gh2md log:
...
Writing to file: issues.md
Github API rate limit: RateLimit(core=Rate(reset=2020-09-17 02:50:05, remaining=977, limit=1000))
Done.
# .github/workflows/issues2md.yml
name: Issues2Markdown
on:
  push: # comment it to reduce update.
  schedule:
    # every day
    - cron: "0 0 * * *"
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
        fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
    - name: Backup github issues to a markdown file.
      run: |
        pip3 install --user --upgrade setuptools
        pip3 install --user gh2md
        $HOME/.local/bin/gh2md $GITHUB_REPOSITORY issues.md --token ${{ secrets.GITHUB_TOKEN }}
        git add issues.md
    - name: Commit files
      run: |
        git config --local user.email "action@github.com"
        git config --local user.name "GitHub Action"
        git commit -m "Backup all issues into issues.md" -a
    - name: Extract branch name
      shell: bash
      run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
      id: extract_branch
    - name: Push changes
      uses: ad-m/github-push-action@master
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        branch: ${{ steps.extract_branch.outputs.branch }}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mattduckcommented, Jul 19, 2020

I’m gonna close this issue just so I know that there’s no work to do on it. Will leave it pinned though.

1reaction
0ut0fcontrolcommented, Jul 17, 2020

@mattduck gh2md works well. If I found any problems or features I will open a issues for it.

My purpose is to backup my repo with issues.

And the issues is readable even when I do not has access to github.com.

Combining gh2md and pandoc --self-contained served my purpose.

(I am not test other tools yet, this may not be the best way to do this.)

Here is a script to setup crontab to fetch repos and convert issues.md to issues.html.

#!/bin/bash

# crontab -e
# 0 1 * * * bash path_to/backup_issues/backup_issues.sh &> path_to/backup_issues/backup_issues.sh.log
# backup_issues
# ├── backup_issues.sh
# ├── repo1
# ├── repo2
# └── repo3

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
for i in $DIR/*/; do
    date
    cd $i
    pwd
    git fetch --all --verbose
    git pull
    test -f issues.md && pandoc --self-contained issues.md -o issues.html --metadata title=backup_issues
    test -f issues.html && echo "backup issues in ${i}issues.html"
    echo "#############################################################################"
done
Read more comments on GitHub >

github_iconTop Results From Across the Web

TODO to Issue · Actions · GitHub Marketplace
This action will convert newly committed TODO comments to GitHub issues on push. It will also optionally close the issues if the TODOs...
Read more >
Features • GitHub Actions
Automate your workflow from idea to production. GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build,...
Read more >
actions/checkout: Action for checking out a repo - GitHub
This action checks-out your repository under $GITHUB_WORKSPACE , so your workflow can access it. Only a single commit is fetched by default, for...
Read more >
Creating an issue - GitHub Docs
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Issues. Issues tab. Click New issue.
Read more >
Monitoring and troubleshooting self-hosted runners
In the left sidebar, click Actions, then click Runners. Under "Runners", you can view a list ... For example, --url https://github.com/octo-org/octo-repo .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found