better file write

This commit is contained in:
2022-06-01 09:04:44 -05:00
parent 5c7a02b5c2
commit a901d21b1e
2 changed files with 11 additions and 2 deletions

View File

@@ -35,7 +35,11 @@ jobs:
run: poetry install run: poetry install
- name: Write creds file - name: Write creds file
run: echo "${{ secrets.TWITTER_TOKEN_FILE }}" > token.json run: python -c "import os; import pathlib; pathlib.Path('token.json').write_text(os.environ['TOKEN_FILE'])"
- name: Run Update - name: Run Update
run: poetry run update --days-ago 1 run: poetry run update --days-ago 1
- name: Clean Up Token File
if: ${{ always() }}
run: rm token.json

View File

@@ -10,6 +10,7 @@ env:
TWITTER_USER_TOKEN: ${{ secrets.TWITTER_USER_TOKEN }} TWITTER_USER_TOKEN: ${{ secrets.TWITTER_USER_TOKEN }}
TWITTER_USER_TOKEN_SECRET: ${{ secrets.TWITTER_USER_TOKEN_SECRET }} TWITTER_USER_TOKEN_SECRET: ${{ secrets.TWITTER_USER_TOKEN_SECRET }}
SHEET_API_KEY: ${{ secrets.SHEET_API_KEY }} SHEET_API_KEY: ${{ secrets.SHEET_API_KEY }}
TOKEN_FILE: ${{ secrets.TOKEN_FILE }}
jobs: jobs:
pull-updates: pull-updates:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -35,7 +36,11 @@ jobs:
run: poetry install run: poetry install
- name: Write creds file - name: Write creds file
run: echo "${{ secrets.TWITTER_TOKEN_FILE }}" > token.json run: python -c "import os; import pathlib; pathlib.Path('token.json').write_text(os.environ['TOKEN_FILE'])"
- name: Run Update - name: Run Update
run: poetry run update run: poetry run update
- name: Clean Up Token File
if: ${{ always() }}
run: rm token.json