From 1701db3b23da842090682f4fa60e9745b739b684 Mon Sep 17 00:00:00 2001 From: TMKnight <548588+tmknight@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:40:03 -0500 Subject: [PATCH 1/6] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f05dfc6..c2be63e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -87,9 +87,10 @@ jobs: tags: | type=ref,event=branch,enable=${{ github.ref_name != 'main' }} type=ref,event=tag - type=raw,enable=${{ !startsWith(github.ref_name, 'dev') }},value=latest + type=raw,enable=${{ github.event_name != 'schedule' && !startsWith(github.ref_name, 'dev') }},value=latest type=raw,enable=${{ github.event_name != 'schedule' && !startsWith(github.ref_name, 'dev') }},priority=1000,value=${{ needs.get-version.outputs.pkg-version }} - + type=raw,enable=${{ github.event_name == 'schedule' ) }},value=nightly + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image From b75af603c90ecd4504b3bafdf3d437b0da6a3f4f Mon Sep 17 00:00:00 2001 From: tmknight Date: Wed, 11 Dec 2024 13:57:30 -0500 Subject: [PATCH 2/6] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c2be63e..18a9456 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -89,8 +89,8 @@ jobs: type=ref,event=tag type=raw,enable=${{ github.event_name != 'schedule' && !startsWith(github.ref_name, 'dev') }},value=latest type=raw,enable=${{ github.event_name != 'schedule' && !startsWith(github.ref_name, 'dev') }},priority=1000,value=${{ needs.get-version.outputs.pkg-version }} - type=raw,enable=${{ github.event_name == 'schedule' ) }},value=nightly - + type=raw,enable=${{ github.event_name == 'schedule' }},value=nightly + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image From 8d4fa38d609fe34071b49f7280c1636362d8f499 Mon Sep 17 00:00:00 2001 From: tmknight Date: Wed, 11 Dec 2024 14:07:03 -0500 Subject: [PATCH 3/6] Simplify connection type option check --- src/inquire/options.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/inquire/options.rs b/src/inquire/options.rs index 388be01..a25990e 100644 --- a/src/inquire/options.rs +++ b/src/inquire/options.rs @@ -91,7 +91,11 @@ pub fn get_opts(args: Vec) -> OptionsList { "", ); opts.optopt("w", "webhook-url", "The webhook url", ""); - opts.optflag("L", "log-persist", "Enable external logging and reporting of historical data"); + opts.optflag( + "L", + "log-persist", + "Enable external logging and reporting of historical data", + ); opts.optopt( "P", "post-action", @@ -119,20 +123,17 @@ pub fn get_opts(args: Vec) -> OptionsList { } // Ensure acceptable connection type arguments - match matches.opt_str("c").is_some() { - true => { - let opt_connection_type = matches.opt_str("c").unwrap(); - match ALLOWED_CONNECTION_TYPES.contains(&opt_connection_type.as_str()) { - true => {} - false => { - println!("Unexpected connection-type: {}", opt_connection_type); - println!("{}", opts.usage(&program)); - std::process::exit(1); - } + if matches.opt_str("c").is_some() { + let opt_connection_type = matches.opt_str("c").unwrap(); + match ALLOWED_CONNECTION_TYPES.contains(&opt_connection_type.as_str()) { + true => {} + false => { + println!("Unexpected connection-type: {}", opt_connection_type); + println!("{}", opts.usage(&program)); + std::process::exit(1); } } - false => {} - }; + } OptionsList { apprise_url: matches.opt_str("a"), From 302dcc48da55eb8480b3418af327f8e2d4c07be3 Mon Sep 17 00:00:00 2001 From: tmknight Date: Wed, 11 Dec 2024 14:53:38 -0500 Subject: [PATCH 4/6] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 18a9456..e7d73fa 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -69,7 +69,7 @@ jobs: - name: Log into Docker Hub id: docker-hub - if: github.event_name != 'pull_request' + if: ${{ github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} From dc4ed09ee7d90255f7347cb4b566ec82b444cfa5 Mon Sep 17 00:00:00 2001 From: tmknight Date: Wed, 11 Dec 2024 15:05:56 -0500 Subject: [PATCH 5/6] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e7d73fa..3450779 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -82,8 +82,8 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE }} tags: | type=ref,event=branch,enable=${{ github.ref_name != 'main' }} type=ref,event=tag From 8eff25a2f7359dd9c1c691412fb2b15a860b435d Mon Sep 17 00:00:00 2001 From: tmknight Date: Wed, 11 Dec 2024 15:18:08 -0500 Subject: [PATCH 6/6] v0.13.8 --- CHANGELOG.md | 8 ++++++++ Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b83b05..7747a51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +## 0.13.8 + +### Changed + +- Simplify 'connection type' option check +- Introduce 'nightly' tag for regular updates to base OS and binary dependencies to ensure vulnerabilities are addressed in between releases + - Reserve 'latest' tag for customary latest release + ## 0.13.7 ### Changed diff --git a/Cargo.toml b/Cargo.toml index a07941f..f34555a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "docker-autoheal" -version = "0.13.7" +version = "0.13.8" authors = ["Travis M Knight"] license = "GPL-3.0" description = "A cross-platform tool to monitor and remediate unhealthy Docker containers"