-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Chaindata Fetch External | ||
|
||
on: | ||
# runs at `0 minutes past the hour, every 6 hours`, starting at midnight UTC | ||
schedule: | ||
- cron: '0 0/6 * * *' | ||
# can be run manually from the `Actions` tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow pushing commits | ||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
concurrency: | ||
# only run 1 job per branch/pr/etc at a time | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
publish: | ||
name: 'Fetch externals and push changes to repo' | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
- name: Fetch external | ||
run: pnpm fetch-external | ||
- name: Commit changes | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git commit -am 'updated externals' | ||
git push |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import startCase from 'lodash/startCase' | ||
|
||
import { doSomeThings } from './fetch-external/steps/doSomeThings' | ||
|
||
const steps: Array<() => Promise<void>> = [doSomeThings] | ||
|
||
for (const [index, executeStep] of steps.entries()) { | ||
console.log(`Executing step ${index + 1}: ${startCase(executeStep.name)}`) | ||
await executeStep() | ||
} | ||
|
||
process.exit(0) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { writeFile } from 'node:fs/promises' | ||
|
||
export const doSomeThings = async () => { | ||
await writeFile( | ||
'assets/test-pls-delete.svg', | ||
`<svg viewBox="0 0 82 82" xmlns="http://www.w3.org/2000/svg"> | ||
<rect width="82" height="82" rx="12" fill="#d5ff5c" /> | ||
<path | ||
d="M62.571 45.425c-1.03 1.03-2.822.563-3.431-.763a1.982 1.982 0 0 1-.185-.829V20.989a5.003 5.003 0 0 0-10.005 0v11.562c0 .994-1.017 1.669-1.967 1.37a1.454 1.454 0 0 1-1.032-1.367V13.987a5.003 5.003 0 0 0-10.005 0v18.568a1.454 1.454 0 0 1-1.034 1.367c-.949.3-1.968-.376-1.968-1.371V20.99a5.003 5.003 0 0 0-10.005 0v22.853c0 .282-.064.556-.182.814-.596 1.294-2.346 1.747-3.355.74l-1.861-1.861a5.002 5.002 0 0 0-7.075 7.074l14.706 14.707a19.976 19.976 0 0 0 15.774 7.697c6.143 0 11.638-2.767 15.31-7.124l15.28-15.28a5.002 5.002 0 0 0-7.074-7.074zM40.945 65.01c8.84 0 16.007-10.005 16.007-10.005s-7.166-10.004-16.007-10.004-16.007 10.004-16.007 10.004S32.105 65.01 40.945 65.01z" | ||
clip-rule="evenodd" | ||
fill="#fd4848" | ||
fill-rule="evenodd" | ||
/> | ||
<path d="M46.949 55.005a6.003 6.003 0 1 1-12.006 0 6.003 6.003 0 0 1 12.006 0z" fill="#fd4848" /> | ||
</svg>` | ||
) | ||
} |