From 3d14b0bf1ad4e4e5b55bc39119a375ef19bc24a3 Mon Sep 17 00:00:00 2001 From: Rafael Sene Date: Fri, 2 Jun 2023 14:19:21 -0300 Subject: [PATCH] Add recipe to push data from Jira to Google Signed-off-by: Rafael Sene --- .github/workflows/daily-push-to-google.yml | 23 ++++++++++++++++++++++ from-jira-to-google.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/daily-push-to-google.yml diff --git a/.github/workflows/daily-push-to-google.yml b/.github/workflows/daily-push-to-google.yml new file mode 100644 index 0000000..d6b3aa1 --- /dev/null +++ b/.github/workflows/daily-push-to-google.yml @@ -0,0 +1,23 @@ +name: Daily Push To Google from Jira + +on: + schedule: + - cron: '0 */8 * * *' # this will run three times a day (every 8 hours) + workflow_dispatch: # this allows the workflow to be run manually from the Actions tab + +jobs: + run-container-and-send-email: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Run Docker Container + run: | + docker run --rm \ + -v $(pwd)/gcp_creds.json:/gcp_creds.json \ + -e JIRA_TOKEN=${{ secrets.JIRA_TOKEN }} \ + -e GOOGLE_SHEETS_TOKEN=${{ secrets.GOOGLE_SHEETS_TOKEN }} \ + -e GOOGLE_SERVICE_ACCOUNT_CREDENTIALS="${{ secrets.GOOGLE_SERVICE_ACCOUNT_CREDENTIALS }}" \ + riscvintl/jira-to-google:latest diff --git a/from-jira-to-google.py b/from-jira-to-google.py index e761275..87ab8bd 100644 --- a/from-jira-to-google.py +++ b/from-jira-to-google.py @@ -143,7 +143,7 @@ def get_quarter_year_format(date): # Function to get Google API credentials from the service account file. # Returns the credentials object. # """ -# creds = Credentials.from_service_account_file('token.json') +# creds = Credentials.from_service_account_file('gcp_creds.json') # # If modifying the scopes, delete the token.json file # SCOPES = ['https://www.googleapis.com/auth/spreadsheets',