Skip to content

Commit 0cae517

Browse files
authored
Create issues2md.yml
1 parent d1e8cb0 commit 0cae517

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/issues2md.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# .github/workflows/issues2md.yml
2+
name: Issues2Markdown
3+
on:
4+
push:
5+
schedule:
6+
# every day
7+
- cron: "0 0 * * *"
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
with:
14+
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
15+
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
16+
- name: Backup github issues to a markdown file.
17+
run: |
18+
pip install wheel
19+
pip install --user gh2md
20+
$HOME/.local/bin/gh2md $GITHUB_REPOSITORY issues.md --token ${{ secrets.GITHUB_TOKEN }}
21+
git add issues.md
22+
- name: Commit files
23+
run: |
24+
git config --local user.email "action@github.com"
25+
git config --local user.name "GitHub Action"
26+
git commit -m "Backup all issues into issues.md" -a
27+
- name: Extract branch name
28+
shell: bash
29+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
30+
id: extract_branch
31+
- name: Push changes
32+
uses: ad-m/github-push-action@master
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
branch: ${{ steps.extract_branch.outputs.branch }}

0 commit comments

Comments
 (0)