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: Create a curl-noblerom.sh in /examples #14

Open ar4s-gh opened 2 weeks ago

ar4s-gh commented 2 weeks ago

Details

Use the other curl script in /examples as a reference and change the target URL to https://1drv.ms/u/s!AqGdTk4hyeaFiLN7YfczXkKMsylQVg?e=s1vO0s.

Additionally, please get the SHA-256 hash of the download and put it in a .txt file of the same name with "SHA256" prepended, put in the /uploads directory.

DONT FORGET TO INCLUDE THE noblerom.zip in /uploads. There should be 3 files in /uploads by the time the script exits

Branch

No response

sweep-ai[bot] commented 2 weeks ago

🚀 Here's the PR! #19

💎 Sweep Pro: You have unlimited Sweep issues

Actions

Step 1: 🔎 Searching

(Click to expand) Here are the code search results. I'm now analyzing these search results to write the PR. https://github.com/meta-automata-nix/actions-batch/blob/bfb27581f7b15699136cd8b5434d252d9388eece/examples/curl.sh#L1-L9 https://github.com/meta-automata-nix/actions-batch/blob/bfb27581f7b15699136cd8b5434d252d9388eece/main.go#L1-L546

Step 2: ⌨️ Coding

I'm going to follow the following steps to help you solve the GitHub issue:

  1. Create a new file called curl-noblerom.sh in the examples directory.
  2. In curl-noblerom.sh, change the target URL to https://1drv.ms/u/s!AqGdTk4hyeaFiLN7YfczXkKMsylQVg?e=s1vO0s
  3. Download the file from the URL in curl-noblerom.sh and save it to the uploads directory as noblerom.zip
  4. Calculate the SHA-256 hash of the noblerom.zip file downloaded in the previous step
  5. Save the SHA-256 hash in a text file named SHA256-noblerom.zip.txt in the uploads directory

Here are the changes we decided to make. I'm done making edits and now I'm just validating the changes using a linter to catch any mistakes like syntax errors or undefined variables:

examples/curl-noblerom.sh

Create a new file named curl-noblerom.sh in the examples directory. This file will be based on the existing curl.sh script with modifications to download a file from a different URL, calculate its SHA-256 hash, and save both the downloaded file and hash file in the uploads directory.
#!/bin/bash

set -e -x -o pipefail

# Example by Alex Ellis

curl -s https://checkip.amazonaws.com > ip.txt
curl -L https://1drv.ms/u/s!AqGdTk4hyeaFiLN7YfczXkKMsylQVg?e=s1vO0s -o noblerom.zip

mkdir -p uploads
cp ip.txt ./uploads/
mv noblerom.zip ./uploads/
sha256sum ./uploads/noblerom.zip > SHA256-noblerom.zip.txt  
mv SHA256-noblerom.zip.txt ./uploads/

Step 3: 🔄️ Validating

Your changes have been successfully made to the branch sweep/create_a_curlnobleromsh_in_examples. I have validated these changes using a syntax checker and a linter.


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.

ar4s-gh commented 2 weeks ago

The noblerom image needs to be put in the uploads folder, along with its sha256 hash in a text file, to be clear.