Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
with:
node-version: '16'
cache: 'yarn'
- name: Install yarn
uses: borales/actions-yarn@v4
with:
cmd: install
- run: corepack enable
- run: yarn install --frozen-lockfile
- name: Yarn test
shell: bash
run: yarn test
50 changes: 39 additions & 11 deletions .github/workflows/update-ofac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
workflow_dispatch:
schedule:
- cron: '10 23 * * *'

permissions:
contents: write
pull-requests: write

jobs:
update:
name: Update OFAC Sanctions List
Expand All @@ -16,14 +21,37 @@ jobs:
cache: 'yarn'
- name: Run script
run: node update-ofac-list.cjs
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4

with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update OFAC sanctions list'
title: 'chore: update OFAC sanctions list'
body: 'This PR updates the OFAC sanctions list.'
branch: 'update-ofac-sanctions-list'
base: 'main'
labels: 'automated'
- name: Open / update Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_BRANCH: update-ofac-sanctions-list
PR_BASE: main
PR_TITLE: 'chore: update OFAC sanctions list'
PR_BODY: 'This PR updates the OFAC sanctions list.'
COMMIT_MESSAGE: 'chore: update OFAC sanctions list'
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -B "$PR_BRANCH"
git add -A
git commit -m "$COMMIT_MESSAGE"
git push -f origin "$PR_BRANCH"
if gh pr view "$PR_BRANCH" --json number >/dev/null 2>&1; then
echo "PR already exists for $PR_BRANCH — branch updated via force-push."
else
gh pr create \
--base "$PR_BASE" \
--head "$PR_BRANCH" \
--title "$PR_TITLE" \
--body "$PR_BODY" \
--label "automated" || \
gh pr create \
--base "$PR_BASE" \
--head "$PR_BRANCH" \
--title "$PR_TITLE" \
--body "$PR_BODY"
fi
Loading