Skip to content

Commit

Permalink
Merge pull request #186 from kintone-labs/SSR-3278_Change-traffic-log…
Browse files Browse the repository at this point in the history
…s-program-authentication-way-from-PAT-to-GitHub-App-Token

SSR-3278: Change traffic log program's authentication way from PAT to…
  • Loading branch information
h000780 committed Dec 14, 2023
2 parents a38075c + b349acc commit 4e845be
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/traffic_logs_perform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Perform traffic logs
on:
schedule:
#every 9:00 UTC+0(18:00 JP Time)
- cron: '0 9 * * *'
jobs:
check:
name: Run traffic logs
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Generate app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app_id: ${{secrets.TRAFFIC_LOGS_APP_ID}}
private_key: ${{ secrets.TRAFFIC_LOGS_APP_PRIVATE_KEY }}
- name: Update config file
run: |
sed -i 's|<kintone-app-id>|${{secrets.TRAFFIC_LOGS_KINTONE_APP_ID}}|' config.json
sed -i 's|<domain>|${{secrets.TRAFFIC_LOGS_KINTONE_APP_DOMAIN}}|' config.json
sed -i 's|<kintone-app-token>|${{secrets.TRAFFIC_LOGS_KINTONE_APP_API_TOKEN}}|' config.json
working-directory: traffic-logs
- name: Perform traffic logs with app token
env:
GITHUB_APP_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
node traffic-logs-kintone-cli.min.js --config ./config.json
working-directory: traffic-logs
8 changes: 8 additions & 0 deletions traffic-logs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"kintone": {
"app": "<kintone-app-id>",
"domain": "<domain>",
"apiToken": "<kintone-app-token>"
},
"githubToken": "<github token>"
}
2 changes: 2 additions & 0 deletions traffic-logs/traffic-logs-kintone-cli.min.js

Large diffs are not rendered by default.

0 comments on commit 4e845be

Please sign in to comment.