Skip to content

Commit

Permalink
fix up hash check
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbudd committed Sep 6, 2024
1 parent 43eb1e1 commit 2f1efc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/checkAddonUrlAndHash.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ module.exports = ({core}, globPattern) => {
});
fileStream.on('end', () => {
const fileHash = hash.digest('hex');
if (fileHash !== sha256) {
if (fileHash.toLowerCase() !== sha256.toLowerCase()) {
console.log(`Hash mismatch: ${fileHash} !== ${sha256}, deleting file`);
exec(`rm "${file}"`, (err, stdout, stderr) => {
if (stderr !== '' || err !== null) {
console.log(`err: ${err}`);
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validateAllAddons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
git commit -m "Delete invalid downloads"
- name: create PR for deleting invalid downloads
if: always()
run: gh pr create -B ${{ github.head_ref }} -H delInvalidDownloads${{ github.run_number }} --title 'Delete invalid add-ons' --body 'Delete add-ons with invalid download links or invalid file hashes'
run: gh pr create -B ${{ github.ref_name }} -H delInvalidDownloads${{ github.run_number }} --title 'Delete invalid add-ons' --body 'Delete add-ons with invalid download links or invalid file hashes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout validate repo
Expand Down

0 comments on commit 2f1efc2

Please sign in to comment.