解锁美版Pixel Felica支持 #114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a basic workflow to help you get started with Actions | |
| name: issues | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| # events but only for the src branch | |
| on: | |
| issues: | |
| types: [opened, edited] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| token: ${{ secrets.PAT }} | |
| - name: Get Issue Info | |
| id: issue-info | |
| env: | |
| ISSUE: ${{toJson(github.event.issue)}} | |
| run: | | |
| ISSUE=$(echo "$ISSUE" | base64 --wrap=0) | |
| echo "::set-output name=issue::$ISSUE" | |
| - name: Generate article | |
| id: generate-article | |
| uses: Shell32-Natsu/blog-article-from-issue-action@v1 | |
| with: | |
| issueJson: ${{ steps.issue-info.outputs.issue }} | |
| authorizedUser: Shell32-Natsu | |
| - name: Show article | |
| if: ${{ steps.generate-article.outputs.valid == 'true' }} | |
| run: echo "${{ steps.generate-article.outputs.article }}" | base64 --decode | |
| - name: Write to file | |
| if: ${{ steps.generate-article.outputs.valid == 'true' }} | |
| run: | | |
| FILE="source/_posts/${{ github.event.issue.title }}.md" | |
| echo "${{ steps.generate-article.outputs.article }}" | base64 --decode > "$FILE" | |
| - name: Commit and Push | |
| if: ${{ steps.generate-article.outputs.valid == 'true' }} | |
| run: | | |
| git config --global user.name 'Donny Xia' | |
| git config --global user.email 'shell32-natsu@users.noreply.github.com' | |
| git add --all | |
| git commit -am "Add article ${{ github.event.issue.title }}" | |
| git push -f | |