Skip to content

Commit

Permalink
ci: add workflow to backup issues using gh2md
Browse files Browse the repository at this point in the history
See #11.
  • Loading branch information
mattduck committed Jul 19, 2020
1 parent 8a95648 commit f4d20ce
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/issues2md.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Action to backup issues using gh2md, contributed by
# https://github.com/0ut0fcontrol.
# See https://github.com/mattduck/gh2md/issues/11.
name: Issues2Markdown
on:
push:
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: |
pip install wheel
pip 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 "[email protected]"
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 }}

0 comments on commit f4d20ce

Please sign in to comment.