meta-automata-nix / actions-batch

Time-sharing supercomputer built on GitHub Actions
https://blog.alexellis.io/github-actions-timesharing-supercomputer/
MIT License
1 stars 0 forks source link

Sweep: Add curl script to download and hash a file #15

Closed sweep-ai[bot] closed 2 weeks ago

sweep-ai[bot] commented 2 weeks ago

Purpose

This pull request adds a new curl script to the /examples directory that downloads a file from a specific URL and generates the SHA-256 hash of the downloaded file, storing it in the /uploads directory.

Description

The changes in this pull request include:

  1. Creating a new script curl-noblerom.sh in the /examples directory that:
    • Retrieves the public IP address and saves it to ip.txt in the current directory
    • Downloads a file from the URL https://1drv.ms/u/s!AqGdTk4hyeaFiLN7YfczXkKMsylQVg?e=s1vO0s and saves it as noblerom.zip
    • Creates the /uploads directory if it doesn't exist
    • Copies the ip.txt file to the /uploads directory
    • Generates the SHA-256 hash of the downloaded noblerom.zip file and saves it to SHA256noblerom.zip.txt in the /uploads directory

Summary

Fixes #14.


[!TIP] To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

This is an automated message generated by Sweep AI.

sweep-ai[bot] commented 2 weeks ago

Sweep: PR Review

Author: sweep-ai[bot]

Sweep Found These Issues

  • In examples/curl-noblerom.sh: The script does not verify the integrity of the downloaded file before computing its hash, which could lead to incorrect hash values if the download is incomplete or corrupted.
  • https://github.com/meta-automata-nix/actions-batch/blob/d2210eb049ef5ec7f3702839a2447406783455bd/examples%2Fcurl-noblerom.sh#L13 [View Diff](https://github.com/meta-automata-nix/actions-batch/pull/15/files#diff-77485823fad3f35be7cf9ef7a762e2a29527c4241aa006c2d05432bd9ddb9224R13)
  • In examples/curl-noblerom.sh: The script does not handle the case where the download URL is inaccessible or the file is not found, which could cause the script to fail without a clear error message.
  • https://github.com/meta-automata-nix/actions-batch/blob/d2210eb049ef5ec7f3702839a2447406783455bd/examples%2Fcurl-noblerom.sh#L8 [View Diff](https://github.com/meta-automata-nix/actions-batch/pull/15/files#diff-77485823fad3f35be7cf9ef7a762e2a29527c4241aa006c2d05432bd9ddb9224R8)

ar4s-gh commented 2 weeks ago

the noblerom image should be put in the uploads folder, along with its sha256 hash in a text file along next to it.

ar4s-gh commented 2 weeks ago

You dun good, except one thing. We need to make sure the noblerom.zip is put in /uploads.

Make sure it is please!