{"id":23340179,"url":"https://github.com/sierrasoftworks/ynab-automation","last_synced_at":"2025-04-09T23:41:56.959Z","repository":{"id":74220253,"uuid":"543788152","full_name":"SierraSoftworks/ynab-automation","owner":"SierraSoftworks","description":"Automatically update the value of your stock portfolio in You Need a Budget","archived":false,"fork":false,"pushed_at":"2025-04-07T23:10:00.000Z","size":4641,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T00:23:26.476Z","etag":null,"topics":["stocks","ynab","ynab-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SierraSoftworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-30T20:58:48.000Z","updated_at":"2025-04-07T23:10:04.000Z","dependencies_parsed_at":"2023-11-26T00:23:56.258Z","dependency_job_id":"5669d8bc-a5ac-4cd4-8230-4a6c5272dee5","html_url":"https://github.com/SierraSoftworks/ynab-automation","commit_stats":null,"previous_names":["sierrasoftworks/ynab-automation"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fynab-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fynab-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fynab-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SierraSoftworks%2Fynab-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SierraSoftworks","download_url":"https://codeload.github.com/SierraSoftworks/ynab-automation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131470,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["stocks","ynab","ynab-api"],"created_at":"2024-12-21T04:19:54.832Z","updated_at":"2025-04-09T23:41:56.930Z","avatar_url":"https://github.com/SierraSoftworks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# You Need a Budget - GitHub Automation\n**Automate your You Need a Budget account using GitHub Actions.**\n\nThis is designed to run as a scheduled GitHub Action to help automate\ncommon account management tasks in [You Need a Budget](https://www.youneedabudget.com/).\n\n## Features\n - **Keep a Stock Account's value up to date.**\n\n    By specifying the number of shares for each ticker as a note on your stock account,\n    this action can automatically fetch the latest stock price from Yahoo! Finance and\n    update your account's balance (it even supports currency conversion).\n\n - **Automatically approve transactions.**\n\n    If you're using YNAB's support for account linking, you might get tired of needing\n    to approve every transaction which is automatically imported. This action can take\n    the toil out of it for you by automatically approving imported transactions which\n    have cleared in your account(s).\n\n- **Replicate transactions between budgets.**\n\n    If you're using multiple YNAB budgets to provide a shared household budget while retaining\n    your own personal budgets, you'll find that this action can take care of automatically\n    copying transactions from one budget to another.\n\n## Setup\n1. Create a new YNAB Personal API Token by following their [guide](https://api.youneedabudget.com/#personal-access-tokens).\n2. Configure your repository's secrets to include the following:\n   - `YNAB_API_KEY`: Your YNAB Personal API Token\n   - `YNAB_BUDGET_ID`: The ID of your YNAB budget, this is the first GUID in the URL when you are viewing your budget in the YNAB web app.\n3. Create your own repository, and place a `.github/workflows/ynab.yaml` file with the following contents.\n   \n   ```yaml\n   name: YNAB\n\n   on:\n     schedule:\n        # Run the automation every 12 hours\n       - cron: '0 */12 * * *'\n\n   jobs:\n     automate-ynab:\n       runs-on: ubuntu-latest\n       steps:\n         - uses: SierraSoftworks/ynab-automation@v2.0\n           with:\n             budget-id: ${{ secrets.YNAB_BUDGET_ID }}\n             api-key: ${{ secrets.YNAB_API_KEY }}\n             cache: true\n   ```\n\n### Automatic Updates\nIf you want to automatically update to the latest version of the YNAB automation, you can add a `.github/dependabot.yml` file\nto your repository with the following contents. It will automatically create pull requests to update your repository when new\nversions are released.\n\n```yaml\nversion: 2\nupdates:\n  - directory: /\n    package-ecosystem: github-actions\n    schedule:\n      interval: weekly\n```\n\n### Caching\nIn general, we recommend running this action with the `cache: true` feature turned on. Doing so will automatically generate a\ncache for various upstream datastores (for example, stock and currency data) to avoid making unnecessary calls to these upstream\ndata providers. If you're running multiple instances of this action (for example, across multiple accounts) this will also significantly\nreduce the chances of you being rate limited.\n\n## Configuration\nYou control the automations which are enabled on your account(s) by adding specific\ncommands to the notes on those accounts. These commands always take the form of\n`/automate:\u003ccommand\u003e \u003cargument\u003e=\u003cvalue\u003e \u003cargument\u003e=\"\u003cvalue\u003e\"`.\n\n### Stock Account\nTo enable the stock account automation, add a note to your stock account with the\nfollowing content:\n\n```\n# Specify your list of stock tickers and the number of shares held for each ticker.\n/automate:stock MSFT=100 AAPL=100 GOOG=100 cost_basis=USD5000 cgt_rate=40%\n```\n\n*Note: You can change the list of stock tickers and the number of shares held for each ticker.*\n\nYou control the calculation of a Capital Gains Tax deduction by specifying the cost basis\nfor your stock holdings and the Capital Gains Tax rate you expect to pay.\n\n### Cross-Budget Replication\nIf you're using multiple YNAB budgets to provide a shared household budget while retaining\nyour own personal budgets, you may find that replicating transactions from your personal\nbudget to the shared household budget to be a tedious task.\n\nFortunately, this automation allows you to automatically replicate transactions from one\nbudget to another by adding a note to your account with the following content:\n\n```\n/automate:replicate to_budget=Household to_account=Alice from_category=Groceries to_category=Food cleared=yes to_flag=blue\n```\n\n### Automated Approvals\nTo enable the automated approvals automation, add a note to your account with the\nfollowing content:\n\n```\n/automate:approve cleared=yes imported=yes\n```\n\n*Note: You can automatically approve transactions which haven't cleared, or weren't imported, by removing the `cleared=yes` and `imported=yes` arguments respectively.*\n\nThis is a relatively simple GitHub Action designed to be run on a schedule to\nupdate an Unlinked Account in YNAB with the current value of your stock portfolio.\n\n### Bottomless Budget\nIf you're just using YNAB to keep track of your spending and don't want to worry\nabout tracking how much money you have available (mostly when using a joint budget\nfor shared spending in conjunction with the **Replication** automation) you may\nwish to use the **Bottomless Budget** automation.\n\nThis automation will automatically set the available balance of your budget to\nzero by adding fake transactions from the \"Bottomless Pit\" payee to your account.\n\n```\n/automate:bottomless name=\"Bottomless Pit\" approved=yes\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsierrasoftworks%2Fynab-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsierrasoftworks%2Fynab-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsierrasoftworks%2Fynab-automation/lists"}