diff --git a/.gitignore b/.gitignore index 492c976..fdc1c35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/target -**/*.rs.bk \ No newline at end of file +**/*.rs.bk +Cargo.lock diff --git a/Dockerfile b/Dockerfile index 5cd18a8..f319013 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM rust:1.71.0-alpine3.18 +FROM rust:1.83.0-alpine3.20 -ENV deny_version="0.14.21" +ENV deny_version="0.16.3" RUN set -eux; \ apk update; \ - apk add bash curl git tar; \ + apk add bash curl git tar openssh; \ curl --silent -L https://github.com/EmbarkStudios/cargo-deny/releases/download/$deny_version/cargo-deny-$deny_version-x86_64-unknown-linux-musl.tar.gz | tar -xzv -C /usr/bin --strip-components=1; # Ensure rustup is up to date. diff --git a/action.yml b/action.yml index e6a902f..fc4dd3b 100644 --- a/action.yml +++ b/action.yml @@ -35,6 +35,18 @@ inputs: description: "The git credentials for credential.helper store using github username and github's private access token (PAT)" required: false default: "" + ssh-key: + description: "Set the used ssh key" + required: false + default: "" + ssh-known-hosts: + description: "Set ssh known hosts" + required: false + default: "" + use-git-cli: + description: "Set CARGO_NET_GIT_FETCH_WITH_CLI" + required: false + default: "false" runs: using: "docker" @@ -42,6 +54,9 @@ runs: args: - ${{ inputs.rust-version }} - ${{ inputs.credentials }} + - ${{ inputs.ssh-key }} + - ${{ inputs.ssh-known-hosts }} + - ${{ inputs.use-git-cli }} - --log-level - ${{ inputs.log-level }} - --manifest-path diff --git a/entrypoint.sh b/entrypoint.sh index 642fc5e..d3612a6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -19,6 +19,30 @@ then chmod 600 "$HOME/.git-credentials" fi +if [ -n "$3" ] +then + mkdir -p "/root/.ssh" + chmod 0700 "/root/.ssh" + echo "${3}" > "/root/.ssh/id_rsa" + chmod 0600 "/root/.ssh/id_rsa" +fi + +if [ -n "$4" ] +then + mkdir -p "/root/.ssh" + chmod 0700 "/root/.ssh" + echo "${4}" > "/root/.ssh/known_hosts" + chmod 0600 "/root/.ssh/known_hosts" +fi + +if [ -n "$5" ] +then + export CARGO_NET_GIT_FETCH_WITH_CLI="$5" +fi + +shift +shift +shift shift shift diff --git a/tag.sh b/tag.sh index 4a68d82..d909b1a 100755 --- a/tag.sh +++ b/tag.sh @@ -12,8 +12,8 @@ git diff-index --quiet HEAD || git commit -m "Bump to $deny_version" # Add the new tag git tag -a "v$version" -m "Release $version - cargo-deny $deny_version" -# Move the v1 tag to the new commit -git tag -fa "v1" -m "Release $version - cargo-deny $deny_version" +# Move the v2 tag to the new commit +git tag -fa "v2" -m "Release $version - cargo-deny $deny_version" git push --tags --force git push