get jpcssblogdev token #66
This file contains 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
name: get jpcssblogdev token | |
on: | |
schedule: | |
- cron: '0 0 1,15 * *' | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: Get JPCSSBlogDev Token | |
id: jpcssblogdev | |
uses: cssjpn/blog-gh-actions/jpcssblogdev-token@v1 | |
- name: Generate GitHub token for writing secrets | |
id: generate_token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.PRIVATE_KEY }} | |
- name: Store a token to repository Secrets | |
env: | |
TOKEN: ${{ steps.jpcssblogdev.outputs.token }} | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
REPOSITORY: ${{ github.event.repository.full_name }} | |
run: | | |
gh secret set JPCSSBLOG_DEV_TOKEN --body "$TOKEN" -R "$REPOSITORY" |