Skip to content

Commit

Permalink
update workflow to run on push
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlingwes committed Feb 6, 2024
1 parent 2097964 commit 9979053
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/gen-killed-in-gaza.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: workflow_dispatch
on:
push:
branches:
- "**"
- "!main"

jobs:
datasets_gen_daily:
Expand Down Expand Up @@ -29,17 +33,25 @@ jobs:
- name: run scripts & diff
run: |
python scripts/data/common/killed-in-gaza/generate_killed_list.py
mkdir -p ci-tmp
bun run gen-killed
git diff killed-in-gaza.json > ci-tmp/killed-in-gaza.diff
- name: commit vars
id: commitvars
run: |
echo "currentdate=$(date '+%Y-%m-%d')" >> "$GITHUB_OUTPUT"
echo "branchname=ci-workflow-$(date '+%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: upload log artifact
uses: actions/upload-artifact@v4
with:
name: killed-in-gaza-log
path: ci-tmp/killed-in-gaza-log.txt

- name: upload diff artifact
uses: actions/upload-artifact@v4
with:
name: killed-in-gaza-diff
path: ci-tmp/killed-in-gaza.diff

- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
name: commit changes
with:
message: "daily: update for ${{ steps.commitvars.outputs.currentdate }}"
new_branch: ${{ steps.commitvars.outputs.branchname }}
add: '["killed-in-gaza.json", "killed-in-gaza.min.json"]'
push: true
2 changes: 1 addition & 1 deletion scripts/data/v2/killed-in-gaza.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const generateJsonFromTranslatedCsv = async () => {
}

if (process.env.CI) {
fs.writeFileSync("gen-killed-result", logLines.join("\n"));
fs.writeFileSync("ci-tmp/killed-in-gaza-log.txt", logLines.join("\n"));
} else {
console.warn(logLines.join("\n"));
}
Expand Down

0 comments on commit 9979053

Please sign in to comment.