mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 07:29:19 -04:00
Two build fixes found while getting the build working on FreeBSD.
1. **Remove hardcoded `#!/bin/bash` paths and use /usr/bin/env instead
/**
2. **env_remove("YARN_BINARY")**
Tested on FreeBSD 16.0-CURRENT amd64.
A second series adds FreeBSD support with `platform` variants,
environment overrides, PyQt6 handling and docs.
Closes #5301
25 lines
891 B
Bash
Executable File
25 lines
891 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Replace version tags with commit hashes in github actions workflows
|
|
# Example: "uses: actions/checkout@v4"
|
|
# -> "uses: actions/checkout@11bd...683 #v4"
|
|
|
|
shopt -s globstar
|
|
|
|
for workflow in .github/**/*.yml; do
|
|
grep -E "uses:[[:space:]]+[A-Za-z0-9._-]+/[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*@v[0-9]+" "$workflow" |
|
|
while read -r line; do
|
|
action=$(echo "$line" | sed -E 's/.*uses:[[:space:]]+([^[:space:]#]+)@v[0-9]+.*/\1/')
|
|
repo=$(echo "$action" | cut -d/ -f1,2)
|
|
tag=$(echo "$line" | sed -E 's/.*@(v[0-9]+).*/\1/')
|
|
|
|
commit_hash=$(git ls-remote "https://github.com/$repo.git" "refs/tags/$tag" | cut -f1)
|
|
|
|
if [ -n "$commit_hash" ]; then
|
|
sed -i.bak -E \
|
|
"s|(uses:[[:space:]]+$action@)$tag|\1$commit_hash #$tag|g" \
|
|
"$workflow"
|
|
rm -f "$workflow.bak"
|
|
fi
|
|
done
|
|
done
|