From e07978033d25d5d7bc77253b64d9b2bd244e33fd Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Thu, 9 Nov 2023 21:56:16 +0100 Subject: [PATCH] Also pin repos themselves --- populate_projects.sh | 15 +++++++++------ projects/Noovolari--leapp/url.txt | 2 +- projects/Rat-Rig--V-core-3/url.txt | 2 +- projects/crystal-lang--crystal-book/url.txt | 2 +- projects/e-maxx-eng--e-maxx-eng/url.txt | 2 +- projects/emacs-lsp--lsp-mode/url.txt | 2 +- projects/gledos--ggame/url.txt | 2 +- projects/ikrima--gamedevguide/url.txt | 2 +- projects/k3d-io--k3d/url.txt | 2 +- projects/librenms--librenms/url.txt | 2 +- projects/mkdocs--mkdocs/url.txt | 2 +- projects/mkdocstrings--mkdocstrings/url.txt | 2 +- projects/nasa-jpl--open-source-rover/url.txt | 2 +- .../ni--systemlink-operations-handbook/url.txt | 2 +- projects/ntno--mkdocs-terminal/url.txt | 2 +- projects/open-amt-cloud-toolkit--docs/url.txt | 2 +- projects/oprypin--mkdocs-gen-files/url.txt | 2 +- projects/seleniumbase--SeleniumBase/url.txt | 2 +- .../spaceship-prompt--spaceship-prompt/url.txt | 2 +- projects/tfeldmann--organize/url.txt | 2 +- 20 files changed, 28 insertions(+), 25 deletions(-) diff --git a/populate_projects.sh b/populate_projects.sh index 1d2e779..2cc5296 100755 --- a/populate_projects.sh +++ b/populate_projects.sh @@ -8,13 +8,16 @@ for d in */; do ( d="${d%/}" cd "$d" printf "%s -> " "$d" >&2 - if [[ ! -f 'url.txt' ]]; then - repo="https://github.com/${d//--//}" - branch="$(git remote show "$repo" | grep -oP 'HEAD branch: \K.+')" - echo "$repo/raw/$branch/mkdocs.yml" >url.txt + if [[ -f 'url.txt' ]]; then + repo=$(grep -oP 'https://github.com/\K[^/]+/[^/]+' url.txt) + path=$(grep -oP '/blob/[^/]+/\K.+' url.txt) + else + repo="${d//--//}" + path='mkdocs.yml' fi - cat url.txt >&2 - curl -s -f -L -- $(cat url.txt) | (mkdocs get-deps -f - || true) | grep . >requirements.in + commit=$(curl -sfL "https://api.github.com/repos/$repo/commits?per_page=1" | jq -r '.[0].sha') + echo "https://github.com/$repo/blob/$commit/$path" | tee /dev/stderr >url.txt + sed 's@/blob/@/raw/@' url.txt | xargs curl -sfL | (mkdocs get-deps -f - || true) | grep . >requirements.in (cat requirements.extra 2>/dev/null || true) >>requirements.in ); done diff --git a/projects/Noovolari--leapp/url.txt b/projects/Noovolari--leapp/url.txt index b8b57f0..30b0e49 100644 --- a/projects/Noovolari--leapp/url.txt +++ b/projects/Noovolari--leapp/url.txt @@ -1 +1 @@ -https://github.com/Noovolari/leapp/raw/master/mkdocs.yml +https://github.com/Noovolari/leapp/blob/11b375de7231a1f15ec95e736e1f779bad3ce6a0/mkdocs.yml diff --git a/projects/Rat-Rig--V-core-3/url.txt b/projects/Rat-Rig--V-core-3/url.txt index 4feb4de..5b25b78 100644 --- a/projects/Rat-Rig--V-core-3/url.txt +++ b/projects/Rat-Rig--V-core-3/url.txt @@ -1 +1 @@ -https://github.com/Rat-Rig/V-core-3/raw/main/mkdocs.yml +https://github.com/Rat-Rig/V-core-3/blob/4f5d91f42c9a9f7ec346c73728fa6329491aad8c/mkdocs.yml diff --git a/projects/crystal-lang--crystal-book/url.txt b/projects/crystal-lang--crystal-book/url.txt index 3749c4f..b050d84 100644 --- a/projects/crystal-lang--crystal-book/url.txt +++ b/projects/crystal-lang--crystal-book/url.txt @@ -1 +1 @@ -https://github.com/crystal-lang/crystal-book/raw/master/mkdocs.yml +https://github.com/crystal-lang/crystal-book/blob/f324ebf79204846bfc0c0b0dd5062f4806891618/mkdocs.yml diff --git a/projects/e-maxx-eng--e-maxx-eng/url.txt b/projects/e-maxx-eng--e-maxx-eng/url.txt index 2c4aec4..550f86d 100644 --- a/projects/e-maxx-eng--e-maxx-eng/url.txt +++ b/projects/e-maxx-eng--e-maxx-eng/url.txt @@ -1 +1 @@ -https://github.com/e-maxx-eng/e-maxx-eng/raw/master/mkdocs.yml +https://github.com/e-maxx-eng/e-maxx-eng/blob/86b132438818fdf37fcfaab3e0048663781cc392/mkdocs.yml diff --git a/projects/emacs-lsp--lsp-mode/url.txt b/projects/emacs-lsp--lsp-mode/url.txt index e24e53f..ce33ead 100644 --- a/projects/emacs-lsp--lsp-mode/url.txt +++ b/projects/emacs-lsp--lsp-mode/url.txt @@ -1 +1 @@ -https://github.com/emacs-lsp/lsp-mode/raw/master/mkdocs.yml +https://github.com/emacs-lsp/lsp-mode/blob/75ea20714635e70ca3da460d1fe558f5057eb373/mkdocs.yml diff --git a/projects/gledos--ggame/url.txt b/projects/gledos--ggame/url.txt index fd27538..397dcee 100644 --- a/projects/gledos--ggame/url.txt +++ b/projects/gledos--ggame/url.txt @@ -1 +1 @@ -https://github.com/gledos/ggame/raw/master/mkdocs.yml +https://github.com/gledos/ggame/blob/ac3cad474b5690484e8ca6ce8a70c14d34555686/mkdocs.yml diff --git a/projects/ikrima--gamedevguide/url.txt b/projects/ikrima--gamedevguide/url.txt index 4283024..458ad3d 100644 --- a/projects/ikrima--gamedevguide/url.txt +++ b/projects/ikrima--gamedevguide/url.txt @@ -1 +1 @@ -https://github.com/ikrima/gamedevguide/raw/master/mkdocs.yml +https://github.com/ikrima/gamedevguide/blob/3dc28e90b93a435eb6f1aac7149246e3390f11a2/mkdocs.yml diff --git a/projects/k3d-io--k3d/url.txt b/projects/k3d-io--k3d/url.txt index b0a1189..dbcd4ed 100644 --- a/projects/k3d-io--k3d/url.txt +++ b/projects/k3d-io--k3d/url.txt @@ -1 +1 @@ -https://github.com/k3d-io/k3d/raw/main/mkdocs.yml +https://github.com/k3d-io/k3d/blob/f73fe36eb0674b9c4b2bc27b36c6dfc8a6151f8c/mkdocs.yml diff --git a/projects/librenms--librenms/url.txt b/projects/librenms--librenms/url.txt index 544e858..3f25b2e 100644 --- a/projects/librenms--librenms/url.txt +++ b/projects/librenms--librenms/url.txt @@ -1 +1 @@ -https://github.com/librenms/librenms/raw/master/mkdocs.yml +https://github.com/librenms/librenms/blob/63eeeb71722237d1461a37bb6da99fda25e02c91/mkdocs.yml diff --git a/projects/mkdocs--mkdocs/url.txt b/projects/mkdocs--mkdocs/url.txt index e1add05..a658b75 100644 --- a/projects/mkdocs--mkdocs/url.txt +++ b/projects/mkdocs--mkdocs/url.txt @@ -1 +1 @@ -https://github.com/mkdocs/mkdocs/raw/master/mkdocs.yml +https://github.com/mkdocs/mkdocs/blob/dc45916aa1cc4b4d4796dd45656bd1ff60d4ce44/mkdocs.yml diff --git a/projects/mkdocstrings--mkdocstrings/url.txt b/projects/mkdocstrings--mkdocstrings/url.txt index 6abffa1..4e1abec 100644 --- a/projects/mkdocstrings--mkdocstrings/url.txt +++ b/projects/mkdocstrings--mkdocstrings/url.txt @@ -1 +1 @@ -https://github.com/mkdocstrings/mkdocstrings/raw/main/mkdocs.yml +https://github.com/mkdocstrings/mkdocstrings/blob/afc4ea4e178d27c755528f22adb7c1a6fce736f2/mkdocs.yml diff --git a/projects/nasa-jpl--open-source-rover/url.txt b/projects/nasa-jpl--open-source-rover/url.txt index ee5824b..5d2eb1b 100644 --- a/projects/nasa-jpl--open-source-rover/url.txt +++ b/projects/nasa-jpl--open-source-rover/url.txt @@ -1 +1 @@ -https://github.com/nasa-jpl/open-source-rover/raw/master/mkdocs.yml +https://github.com/nasa-jpl/open-source-rover/blob/8f1b426f64efa581a7fc2d9f95b003a25365796a/mkdocs.yml diff --git a/projects/ni--systemlink-operations-handbook/url.txt b/projects/ni--systemlink-operations-handbook/url.txt index 4b90958..10df8a4 100644 --- a/projects/ni--systemlink-operations-handbook/url.txt +++ b/projects/ni--systemlink-operations-handbook/url.txt @@ -1 +1 @@ -https://github.com/ni/systemlink-operations-handbook/raw/master/mkdocs.yml +https://github.com/ni/systemlink-operations-handbook/blob/94551b22f75a8e611d013326c73849d22282fb3d/mkdocs.yml diff --git a/projects/ntno--mkdocs-terminal/url.txt b/projects/ntno--mkdocs-terminal/url.txt index aba16e6..54f0c8c 100644 --- a/projects/ntno--mkdocs-terminal/url.txt +++ b/projects/ntno--mkdocs-terminal/url.txt @@ -1 +1 @@ -https://github.com/ntno/mkdocs-terminal/raw/main/documentation/mkdocs.yml +https://github.com/ntno/mkdocs-terminal/blob/7d88d64b4dd8175814f79b4989431353a7fe621c/documentation/mkdocs.yml diff --git a/projects/open-amt-cloud-toolkit--docs/url.txt b/projects/open-amt-cloud-toolkit--docs/url.txt index 752d625..89561b3 100644 --- a/projects/open-amt-cloud-toolkit--docs/url.txt +++ b/projects/open-amt-cloud-toolkit--docs/url.txt @@ -1 +1 @@ -https://github.com/open-amt-cloud-toolkit/docs/raw/main/mkdocs.yml +https://github.com/open-amt-cloud-toolkit/docs/blob/a9ea9491300e3a9b2fa5db3710b9033bbe69abf9/mkdocs.yml diff --git a/projects/oprypin--mkdocs-gen-files/url.txt b/projects/oprypin--mkdocs-gen-files/url.txt index a95008d..5e9827a 100644 --- a/projects/oprypin--mkdocs-gen-files/url.txt +++ b/projects/oprypin--mkdocs-gen-files/url.txt @@ -1 +1 @@ -https://github.com/oprypin/mkdocs-gen-files/raw/master/mkdocs.yml +https://github.com/oprypin/mkdocs-gen-files/blob/e5cdd6c044c079a4d8c59b73755c00ace97a2325/mkdocs.yml diff --git a/projects/seleniumbase--SeleniumBase/url.txt b/projects/seleniumbase--SeleniumBase/url.txt index 91e042e..d5e5133 100644 --- a/projects/seleniumbase--SeleniumBase/url.txt +++ b/projects/seleniumbase--SeleniumBase/url.txt @@ -1 +1 @@ -https://github.com/seleniumbase/SeleniumBase/raw/master/mkdocs.yml +https://github.com/seleniumbase/SeleniumBase/blob/62e7a043636f4fbe5804fb8f4684eeb6224a51f2/mkdocs.yml diff --git a/projects/spaceship-prompt--spaceship-prompt/url.txt b/projects/spaceship-prompt--spaceship-prompt/url.txt index 73629fb..ab9552f 100644 --- a/projects/spaceship-prompt--spaceship-prompt/url.txt +++ b/projects/spaceship-prompt--spaceship-prompt/url.txt @@ -1 +1 @@ -https://github.com/spaceship-prompt/spaceship-prompt/raw/master/mkdocs.yml +https://github.com/spaceship-prompt/spaceship-prompt/blob/be826cbe2bb11a0675dd71f548ff1396608da7ea/mkdocs.yml diff --git a/projects/tfeldmann--organize/url.txt b/projects/tfeldmann--organize/url.txt index 7945594..e622b90 100644 --- a/projects/tfeldmann--organize/url.txt +++ b/projects/tfeldmann--organize/url.txt @@ -1 +1 @@ -https://github.com/tfeldmann/organize/raw/main/mkdocs.yml +https://github.com/tfeldmann/organize/blob/0d254e984e555094b0958d2f8733b91ebc5fe641/mkdocs.yml