Skip to content

Commit 2e42573

Browse files
RageZBlagithub-actions[bot]ann-kilzer
authored
feat: Update events JSON file using GitHub Action (#247)
* feat: add script to update the events.json using connpass API The script requires: - jq - curl - connpass API key set as `CONNPASS_API_KEY` * fix: use full path for env * chore: add CI workflow to update the event data * chore: update comment in workflow to make it explicit it run on Saturdays * fix: YAML syntax * fix: redid the workflow create-pull-request settings * fix: run docker manually because of the create-pull-request expect git to be avaible * chore: update events.json (#248) Co-authored-by: RageZBla <1196871+RageZBla@users.noreply.github.com> * fix: set the base branch for the pull request to main * chore: revert events.json * refactor: run the event update everyday * refactor: directly commit and push to main * fix: configure git user name and email * fix: typo in CI script * Update events.json * fix: ref should be main * chrore: update comment Co-authored-by: Ann Kilzer キルザー杏 <4602369+ann-kilzer@users.noreply.github.com> * Revert "fix: ref should be main" This reverts commit ec5f5b2. * Revert "fix: typo in CI script" This reverts commit c3ba891. * Revert "fix: configure git user name and email" This reverts commit 45eeff6. * Revert "refactor: directly commit and push to main" This reverts commit eda4a75. * refactor: auto-approve and auto-merge events pull request Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com> * fix: add token to auto-approve and auto-merge github job Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com> * fix: checkout main Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com> * refactor: remove auto approval and merge for events workflow Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com> * chore: resync the events.json Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com> --------- Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: RageZBla <1196871+RageZBla@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ann Kilzer キルザー杏 <4602369+ann-kilzer@users.noreply.github.com>
1 parent 47c41b7 commit 2e42573

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Update Events JSON
2+
3+
on:
4+
schedule:
5+
# 0:00 UTC is 9:00 JST, run daily
6+
- cron: '0 0 * * *'
7+
workflow_dispatch:
8+
9+
10+
jobs:
11+
update-events:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
env:
17+
CONNPASS_API_KEY: ${{ secrets.CONNPASS_API_KEY }}
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: main
23+
24+
- name: Run update script and validate
25+
run: |
26+
chmod +x scripts/update-events.sh
27+
docker run -v $PWD:/target -e "CONNPASS_API_KEY=$CONNPASS_API_KEY" dwdraju/alpine-curl-jq bash /target/scripts/update-events.sh
28+
jq . src/routes/Event/events.json
29+
30+
- name: Create Pull Request
31+
id: cpr
32+
uses: peter-evans/create-pull-request@v7
33+
with:
34+
commit-message: "chore: update events.json"
35+
branch: "chore-update-events-"
36+
branch-suffix: "timestamp"
37+
delete-branch: true
38+
title: "chore: update events [auto]"
39+
body: |
40+
Update events.json
41+
- Updated with *today's* data
42+
- Auto-generated by [create-pull-request][1]
43+
44+
[1]: https://github.com/peter-evans/create-pull-request
45+
labels: |
46+
events
47+
automated pr
48+
draft: false
49+
base: main

0 commit comments

Comments
 (0)