Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I have an endpoint that works within a browser but fails to download the data to a file.

My flat.yaml is

name: Flat

on:
  push:
    branches:
      - main
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * 0'

jobs:
  scheduled:
    runs-on: ubuntu-latest
    steps:
      # This step installs Deno, which is a new Javascript runtime that improves on Node. Can be used for an optional postprocessing step
      - name: Setup deno
        uses: denoland/setup-deno@main
        with:
          deno-version: v1.x
      # Check out the repository so it can read the files inside of it and do other operations
      - name: Check out repo
        uses: actions/checkout@v2
      # The Flat Action step. We fetch the data in the http_url and save it as downloaded_filename
      - name: Fetch data
        uses: githubocto/flat@v3
        with:
          http_url: endpoint
          downloaded_filename: data.json 
          #postprocess: ./postprocess.ts

Could it be that http_url is refused connection?
The action sucessfully runs but no data is downloaded.

You must be logged in to vote

Replies: 1 comment · 3 replies

Comment options

Hi there, can you clarify if the data.json file got downloaded once and then not updated? Or did it not get downloaded at all by the Action?

I ask because if the endpoint file hasn't changed, the Action won't update the local file. It'll use git to compare the two files and only commit if the data has changed.

You must be logged in to vote
3 replies
@withviz
Comment options

Hi, I have just removed data.json and tried again. The action successfully runs and data.json is created, but it is 0 bytes. So it hasn't downloaded any data at all. The endpoint works in a browser, so I am not sure why the action can't save any data.

@irealva
Comment options

Could you link to the repo you're working off of or the endpoint URL so we can try to debug?

@irealva
Comment options

Also make sure you don't need any kind of authorization headers: https://github.com/githubocto/flat#authorization-optional to access that URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.