From 538227aa8df707756c23ce2cd8a818ec909e363a Mon Sep 17 00:00:00 2001 From: Gabriel Rufino Date: Sat, 7 Dec 2024 13:46:08 -0300 Subject: [PATCH] feat: output password --- .github/workflows/{release.yml => cd.yml} | 4 ++-- .github/workflows/ci.yml | 1 + action.yml | 3 +++ entrypoint.sh | 7 ++++++- 4 files changed, 12 insertions(+), 3 deletions(-) rename .github/workflows/{release.yml => cd.yml} (82%) diff --git a/.github/workflows/release.yml b/.github/workflows/cd.yml similarity index 82% rename from .github/workflows/release.yml rename to .github/workflows/cd.yml index 366fe39..deb7a21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/cd.yml @@ -1,9 +1,9 @@ -name: Release +name: CD on: push: tags: - - v[0-9]+.[0-9]+.[0-9]+ + - v* permissions: contents: write diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fb196b..b4c8f41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: - uses: ./ with: connection-string: mongodb://root:root@database:27017 + output-password: '12345678' - uses: actions/upload-artifact@v4 with: name: dump-mongo${{ matrix.mongo-version }} diff --git a/action.yml b/action.yml index 358f939..1866599 100644 --- a/action.yml +++ b/action.yml @@ -7,9 +7,12 @@ branding: inputs: connection-string: required: true + output-password: + required: true runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.connection-string }} + - ${{ inputs.output-password }} diff --git a/entrypoint.sh b/entrypoint.sh index 2335086..cf9b6ae 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,8 +1,13 @@ #!/bin/sh -l apt update && apt upgrade -y +apt install zip -y cd /action mongodump $1 + +zip -P $2 -r dump.zip dump +rm -rf dump + mkdir $GITHUB_WORKSPACE/dump -cp -r dump $GITHUB_WORKSPACE/dump +cp -r dump.zip $GITHUB_WORKSPACE/dump