-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Pin external references on a release
This pins references to external specs (distribution and runtime) to their latest release on a release of this project. Signed-off-by: Brandon Mitchell <git@bmitch.net>
- Loading branch information
1 parent
da92727
commit 5db69d9
Showing
2 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
cd "$(dirname $0)/.." | ||
|
||
if [ ! -x "$(command -v curl )" ] || [ ! -x "$(command -v jq )" ] || [ ! -x "$(command -v find )" ] || [ ! -x "$(command -v sed )" ]; then | ||
echo "This command requires the following to run: curl, find, jq, and sed" >&2 | ||
exit 1 | ||
fi | ||
|
||
runtime_tag=$(curl -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/opencontainers/runtime-spec/releases/latest \ | ||
| jq -r .tag_name) | ||
|
||
distribution_tag=$(curl -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/opencontainers/distribution-spec/releases/latest \ | ||
| jq -r .tag_name) | ||
|
||
find . -name '*.md' -exec sed -i \ | ||
-e "s#https://github.com/opencontainers/runtime-spec/blob/main/#https://github.com/opencontainers/runtime-spec/blob/${runtime_tag}/#g" \ | ||
-e "s#https://github.com/opencontainers/distribution-spec/blob/main/#https://github.com/opencontainers/distribution-spec/blob/${distribution_tag}/#g" \ | ||
'{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters