diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml new file mode 100644 index 000000000..9573646e7 --- /dev/null +++ b/.github/workflows/dependency-updates.yml @@ -0,0 +1,110 @@ +--- +name: 'dependency-updates' + +# yamllint disable-line rule:truthy +on: + schedule: + - cron: '0 6 * * *' + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + prepare: + name: prepare + runs-on: ubuntu-24.04 + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Clone + uses: actions/checkout@v6 + + - name: Build dependency matrix + id: matrix + run: | + matrix=$(jq -c ' + [ + (.dependencies[] | {section: "dependencies", name, version, url: .urls.amd64}), + (.predependencies[] | {section: "predependencies", name, version, url: .urls.amd64}), + (.recommendations[] | {section: "recommendations", name, version, url: .urls.amd64}) + ] + | map(. + {repo: (.url | capture("https://github.com/(?[^/]+/[^/]+)/releases").r)}) + | map(del(.url)) + | {include: .} + ' contrib/dependencies.json) + echo "matrix=${matrix}" >> "$GITHUB_OUTPUT" + + update: + name: 'update / ${{ matrix.name }}' + runs-on: ubuntu-24.04 + needs: prepare + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + concurrency: + group: dependency-updates-${{ matrix.name }} + cancel-in-progress: false + steps: + - name: Clone + uses: actions/checkout@v6 + + - name: Resolve latest release + id: latest + env: + GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + REPO: ${{ matrix.repo }} + CURRENT: ${{ matrix.version }} + run: | + tag=$(gh release view --repo "$REPO" --json tagName -q .tagName) + latest="${tag#v}" + echo "latest=${latest}" >> "$GITHUB_OUTPUT" + if dpkg --compare-versions "$latest" gt "$CURRENT"; then + echo "outdated=true" >> "$GITHUB_OUTPUT" + else + echo "outdated=false" >> "$GITHUB_OUTPUT" + fi + + - name: Bump dependency entry + if: steps.latest.outputs.outdated == 'true' + env: + SECTION: ${{ matrix.section }} + NAME: ${{ matrix.name }} + OLD: ${{ matrix.version }} + NEW: ${{ steps.latest.outputs.latest }} + run: | + tmp=$(mktemp) + jq --arg section "$SECTION" \ + --arg name "$NAME" \ + --arg old "$OLD" \ + --arg new "$NEW" ' + ($old) as $oldv | + ($new) as $newv | + (.[$section]) |= map( + if .name == $name then + .version = $newv + | .urls.amd64 |= (gsub("v" + $oldv; "v" + $newv) | gsub($oldv; $newv)) + | .urls.arm64 |= (gsub("v" + $oldv; "v" + $newv) | gsub($oldv; $newv)) + else . end + ) + ' contrib/dependencies.json > "$tmp" + mv "$tmp" contrib/dependencies.json + + - name: Open pull request + if: steps.latest.outputs.outdated == 'true' + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} + branch: chore/bump-${{ matrix.name }}-${{ steps.latest.outputs.latest }} + base: ${{ github.ref_name }} + delete-branch: true + committer: 'Dokku Bot ' + author: 'Dokku Bot ' + commit-message: 'chore: bump ${{ matrix.name }} to ${{ steps.latest.outputs.latest }}' + title: 'chore: bump ${{ matrix.name }} to ${{ steps.latest.outputs.latest }}' + body: | + Bumps `${{ matrix.name }}` from `${{ matrix.version }}` to `${{ steps.latest.outputs.latest }}`. + + Release notes: https://github.com/${{ matrix.repo }}/releases/tag/v${{ steps.latest.outputs.latest }} + labels: dependencies diff --git a/contrib/dependencies.json b/contrib/dependencies.json index 7152bc043..040b4f01b 100644 --- a/contrib/dependencies.json +++ b/contrib/dependencies.json @@ -2,94 +2,94 @@ "dependencies": [ { "name": "docker-container-healthchecker", - "version": "0.14.0", + "version": "0.15.0", "urls": { - "amd64": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.14.0/docker-container-healthchecker-linux-amd64", - "arm64": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.14.0/docker-container-healthchecker-linux-arm64" + "amd64": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.15.0/docker-container-healthchecker-linux-amd64", + "arm64": "https://github.com/dokku/docker-container-healthchecker/releases/download/v0.15.0/docker-container-healthchecker-linux-arm64" } }, { "name": "docker-image-labeler", - "version": "0.8.1", + "version": "0.9.0", "urls": { - "amd64": "https://github.com/dokku/docker-image-labeler/releases/download/v0.8.1/docker-image-labeler-linux-amd64", - "arm64": "https://github.com/dokku/docker-image-labeler/releases/download/v0.8.1/docker-image-labeler-linux-arm64" + "amd64": "https://github.com/dokku/docker-image-labeler/releases/download/v0.9.0/docker-image-labeler-linux-amd64", + "arm64": "https://github.com/dokku/docker-image-labeler/releases/download/v0.9.0/docker-image-labeler-linux-arm64" } }, { "name": "lambda-builder", - "version": "0.9.1", + "version": "0.9.2", "urls": { - "amd64": "https://github.com/dokku/lambda-builder/releases/download/v0.9.1/lambda-builder-linux-amd64", - "arm64": "https://github.com/dokku/lambda-builder/releases/download/v0.9.1/lambda-builder-linux-arm64" + "amd64": "https://github.com/dokku/lambda-builder/releases/download/v0.9.2/lambda-builder-linux-amd64", + "arm64": "https://github.com/dokku/lambda-builder/releases/download/v0.9.2/lambda-builder-linux-arm64" } }, { "name": "netrc", - "version": "0.10.2", + "version": "0.10.3", "urls": { - "amd64": "https://github.com/dokku/netrc/releases/download/v0.10.2/netrc-linux-amd64", - "arm64": "https://github.com/dokku/netrc/releases/download/v0.10.2/netrc-linux-arm64" + "amd64": "https://github.com/dokku/netrc/releases/download/v0.10.3/netrc-linux-amd64", + "arm64": "https://github.com/dokku/netrc/releases/download/v0.10.3/netrc-linux-arm64" } }, { "name": "procfile-util", - "version": "0.20.3", + "version": "0.20.4", "urls": { - "amd64": "https://github.com/dokku/procfile-util/releases/download/v0.20.3/procfile-util-linux-amd64", - "arm64": "https://github.com/dokku/procfile-util/releases/download/v0.20.3/procfile-util-linux-arm64" + "amd64": "https://github.com/dokku/procfile-util/releases/download/v0.20.4/procfile-util-linux-amd64", + "arm64": "https://github.com/dokku/procfile-util/releases/download/v0.20.4/procfile-util-linux-arm64" } }, { "name": "sshcommand", - "version": "0.20.0", + "version": "0.20.1", "urls": { - "amd64": "https://github.com/dokku/sshcommand/releases/download/v0.20.0/sshcommand", - "arm64": "https://github.com/dokku/sshcommand/releases/download/v0.20.0/sshcommand" + "amd64": "https://github.com/dokku/sshcommand/releases/download/v0.20.1/sshcommand", + "arm64": "https://github.com/dokku/sshcommand/releases/download/v0.20.1/sshcommand" } } ], "predependencies": [ { "name": "gliderlabs-sigil", - "version": "0.11.4", + "version": "0.12.0", "urls": { - "amd64": "https://github.com/gliderlabs/sigil/releases/download/v0.11.4/sigil-linux-amd64", - "arm64": "https://github.com/gliderlabs/sigil/releases/download/v0.11.4/sigil-linux-arm64" + "amd64": "https://github.com/gliderlabs/sigil/releases/download/v0.12.0/sigil-linux-amd64", + "arm64": "https://github.com/gliderlabs/sigil/releases/download/v0.12.0/sigil-linux-arm64" } }, { "name": "plugn", - "version": "0.16.0", + "version": "0.17.0", "urls": { - "amd64": "https://github.com/dokku/plugn/releases/download/v0.16.0/plugn-linux-amd64", - "arm64": "https://github.com/dokku/plugn/releases/download/v0.16.0/plugn-linux-arm64" + "amd64": "https://github.com/dokku/plugn/releases/download/v0.17.0/plugn-linux-amd64", + "arm64": "https://github.com/dokku/plugn/releases/download/v0.17.0/plugn-linux-arm64" } } ], "recommendations": [ { "name": "dokku-event-listener", - "version": "0.17.2", + "version": "0.19.0", "urls": { - "amd64": "https://github.com/dokku/dokku-event-listener/releases/download/v0.17.2/dokku-event-listener-linux-amd64", - "arm64": "https://github.com/dokku/dokku-event-listener/releases/download/v0.17.2/dokku-event-listener-linux-arm64" + "amd64": "https://github.com/dokku/dokku-event-listener/releases/download/v0.19.0/dokku-event-listener-linux-amd64", + "arm64": "https://github.com/dokku/dokku-event-listener/releases/download/v0.19.0/dokku-event-listener-linux-arm64" } }, { "name": "dokku-update", - "version": "0.9.6", + "version": "0.9.8", "urls": { - "amd64": "https://github.com/dokku/dokku-update/releases/download/v0.9.6/dokku-update", - "arm64": "https://github.com/dokku/dokku-update/releases/download/v0.9.6/dokku-update" + "amd64": "https://github.com/dokku/dokku-update/releases/download/v0.9.8/dokku-update", + "arm64": "https://github.com/dokku/dokku-update/releases/download/v0.9.8/dokku-update" } }, { "name": "herokuish", - "version": "0.11.8", + "version": "0.11.11", "urls": { - "amd64": "https://github.com/gliderlabs/herokuish/releases/download/v0.11.8/herokuish_0.11.8_linux_x86_64.tgz", - "arm64": "https://github.com/gliderlabs/herokuish/releases/download/v0.11.8/herokuish_0.11.8_linux_x86_64.tgz" + "amd64": "https://github.com/gliderlabs/herokuish/releases/download/v0.11.11/herokuish_0.11.11_linux_x86_64.tgz", + "arm64": "https://github.com/gliderlabs/herokuish/releases/download/v0.11.11/herokuish_0.11.11_linux_x86_64.tgz" } } ] diff --git a/tests/unit/config.bats b/tests/unit/config.bats index af758b96a..e9bfb1fce 100644 --- a/tests/unit/config.bats +++ b/tests/unit/config.bats @@ -506,7 +506,7 @@ teardown() { run /bin/bash -c "dokku --app $TEST_APP config:show" echo "output: $output" echo "status: $status" - assert_output "=====> $TEST_APP env vars"$'\nBKEY: true\nDOKKU_PROXY_PORT: 80\naKey: true\nbKey: true\nzKey: true' + assert_output "=====> $TEST_APP env vars"$'\nBKEY: true\naKey: true\nbKey: true\nzKey: true' } @test "(config) config:export" { @@ -518,20 +518,20 @@ teardown() { run /bin/bash -c "dokku config:export --format docker-args $TEST_APP" echo "output: $output" echo "status: $status" - assert_output "--env=BKEY='true' --env=DOKKU_PROXY_PORT='80' --env=aKey='true' --env=bKey='true' --env=zKey='true'" + assert_output "--env=BKEY='true' --env=aKey='true' --env=bKey='true' --env=zKey='true'" run /bin/bash -c "dokku config:export --format shell $TEST_APP" echo "output: $output" echo "status: $status" - assert_output "BKEY='true' DOKKU_PROXY_PORT='80' aKey='true' bKey='true' zKey='true' " + assert_output "BKEY='true' aKey='true' bKey='true' zKey='true' " run /bin/bash -c "dokku config:export --format json $TEST_APP" echo "output: $output" echo "status: $status" - assert_output '{"BKEY":"true","DOKKU_PROXY_PORT":"80","aKey":"true","bKey":"true","zKey":"true"}' + assert_output '{"BKEY":"true","aKey":"true","bKey":"true","zKey":"true"}' run /bin/bash -c "dokku config:export --format json-list $TEST_APP" echo "output: $output" echo "status: $status" - assert_output '[{"name":"BKEY","value":"true"},{"name":"DOKKU_PROXY_PORT","value":"80"},{"name":"aKey","value":"true"},{"name":"bKey","value":"true"},{"name":"zKey","value":"true"}]' + assert_output '[{"name":"BKEY","value":"true"},{"name":"aKey","value":"true"},{"name":"bKey","value":"true"},{"name":"zKey","value":"true"}]' }