diff --git a/.github/workflows/docker-mod-builder.yml b/.github/workflows/docker-mod-builder.yml index 9003677..6601656 100644 --- a/.github/workflows/docker-mod-builder.yml +++ b/.github/workflows/docker-mod-builder.yml @@ -18,6 +18,9 @@ on: MOD_VERSION: required: false type: string + MOD_VERSION_OVERRIDE: + required: false + type: string MULTI_ARCH: required: false type: string @@ -36,32 +39,38 @@ jobs: runs-on: ubuntu-latest steps: - name: Check Out Repo (Commit) - uses: actions/checkout@v4 + uses: actions/checkout@v7 if: ${{ github.event_name != 'pull_request_target' }} + with: + persist-credentials: false - name: Check Out Repo (PR) - uses: actions/checkout@v4 + uses: actions/checkout@v7 if: ${{ github.event_name == 'pull_request_target' }} with: ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false - name: Set Vars run: | + echo "GITHUB_REPO=${{ inputs.GITHUB_REPO }}" >> $GITHUB_ENV + echo "ENDPOINT=${{ inputs.ENDPOINT }}" >> $GITHUB_ENV echo "BASEIMAGE=${{ inputs.BASEIMAGE }}" >> $GITHUB_ENV - echo "BASEIMAGE=${{ inputs.BASEIMAGE }}" >> $GITHUB_STEP_SUMMARY echo "MODNAME=${{ inputs.MODNAME }}" >> $GITHUB_ENV - echo "MODNAME=${{ inputs.MODNAME }}" >> $GITHUB_STEP_SUMMARY - echo "ENDPOINT=${{ inputs.ENDPOINT }}" >> $GITHUB_ENV - echo "ENDPOINT=${{ inputs.ENDPOINT }}" >> $GITHUB_STEP_SUMMARY - echo "GITHUB_REPO=${{ inputs.GITHUB_REPO }}" >> $GITHUB_ENV - echo "GITHUB_REPO=${{ inputs.GITHUB_REPO }}" >> $GITHUB_STEP_SUMMARY echo "MOD_VERSION=${{ inputs.MOD_VERSION }}" >> $GITHUB_ENV - echo "MOD_VERSION=${{ inputs.MOD_VERSION }}" >> $GITHUB_STEP_SUMMARY - echo "MULTI_ARCH=${{ inputs.MULTI_ARCH }}" >> $GITHUB_ENV - echo "MULTI_ARCH=${{ inputs.MULTI_ARCH }}" >> $GITHUB_STEP_SUMMARY + echo "MOD_VERSION_OVERRIDE=${{ inputs.MOD_VERSION_OVERRIDE || 'false' }}" >> $GITHUB_ENV + echo "MULTI_ARCH=${{ inputs.MULTI_ARCH || 'false' }}" >> $GITHUB_ENV + echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY + echo "> GITHUB_REPO=${{ inputs.GITHUB_REPO }}" >> $GITHUB_STEP_SUMMARY + echo "> ENDPOINT=${{ inputs.ENDPOINT }}" >> $GITHUB_STEP_SUMMARY + echo "> BASEIMAGE=${{ inputs.BASEIMAGE }}" >> $GITHUB_STEP_SUMMARY + echo "> MODNAME=${{ inputs.MODNAME }}" >> $GITHUB_STEP_SUMMARY + echo "> MOD_VERSION=${{ inputs.MOD_VERSION }}" >> $GITHUB_STEP_SUMMARY + echo "> MOD_VERSION_OVERRIDE=${{ inputs.MOD_VERSION_OVERRIDE || 'false' }}" >> $GITHUB_STEP_SUMMARY + echo "> MULTI_ARCH=${{ inputs.MULTI_ARCH || 'false' }}" >> $GITHUB_STEP_SUMMARY - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Build image run: | @@ -75,7 +84,11 @@ jobs: run: | DOCKERHUB_TAGS="${ENDPOINT}:${BASEIMAGE}-${MODNAME} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}" if [[ -n "${MOD_VERSION}" ]]; then - DOCKERHUB_TAGS="${DOCKERHUB_TAGS} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${MOD_VERSION} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${MOD_VERSION}-${{ github.sha }}" + if [[ "${MOD_VERSION_OVERRIDE,,}" == "true" ]]; then + DOCKERHUB_TAGS="${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${MOD_VERSION} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${MOD_VERSION}-${{ github.sha }}" + else + DOCKERHUB_TAGS="${DOCKERHUB_TAGS} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${MOD_VERSION} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${MOD_VERSION}-${{ github.sha }}" + fi fi echo "DOCKERHUB_TAGS=${DOCKERHUB_TAGS}" >> $GITHUB_ENV if [[ "${MULTI_ARCH,,}" == "true" ]]; then @@ -129,29 +142,26 @@ jobs: if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.GITHUB_REPO == github.repository && env.CR_USER && env.CR_PAT }} run: | if [[ "${MULTI_ARCH,,}" == "true" ]]; then - echo "Pushed the following images/tags to GHCR:" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following images/tags to GHCR:\n\n" >> $GITHUB_STEP_SUMMARY for i in ${DOCKERHUB_TAGS}; do ighcr="${i/#/ghcr.io\/}" docker push ${ighcr/:/:amd64-} - echo "${ighcr/:/:amd64-}" >> $GITHUB_STEP_SUMMARY + echo "\`${ighcr/:/:amd64-}\`" >> $GITHUB_STEP_SUMMARY docker push ${ighcr/:/:arm64v8-} - echo "${ighcr/:/:arm64v8-}" >> $GITHUB_STEP_SUMMARY + echo "\`${ighcr/:/:arm64v8-}\`" >> $GITHUB_STEP_SUMMARY done - echo "Pushed the following manifests to GHCR:" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following manifests to GHCR:\n\n" >> $GITHUB_STEP_SUMMARY for i in ${DOCKERHUB_TAGS}; do ighcr="${i/#/ghcr.io\/}" - docker manifest push --purge ${ighcr} || : - docker manifest create ${ighcr} ${ighcr/:/:amd64-} ${ighcr/:/:arm64v8-} - docker manifest annotate ${ighcr} ${ighcr/:/:arm64v8-} --os linux --arch arm64 --variant v8 - docker manifest push --purge ${ighcr} - echo "${ighcr}" >> $GITHUB_STEP_SUMMARY + docker buildx imagetools create -t ${ighcr} ${ighcr/:/:amd64-} ${ighcr/:/:arm64v8-} + echo "\`${ighcr}\`" >> $GITHUB_STEP_SUMMARY done else - echo "Pushed the following images/tags to GHCR:" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following images/tags to GHCR:\n\n" >> $GITHUB_STEP_SUMMARY for i in ${DOCKERHUB_TAGS}; do ighcr="${i/#/ghcr.io\/}" docker push ${ighcr} - echo "${ighcr}" >> $GITHUB_STEP_SUMMARY + echo "\`${ighcr}\`" >> $GITHUB_STEP_SUMMARY done fi @@ -161,23 +171,20 @@ jobs: if [[ "${MULTI_ARCH,,}" == "true" ]]; then docker push ghcr.io/${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }} docker push ghcr.io/${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} - echo "Pushed the following PR images/tags to GHCR:" >> $GITHUB_STEP_SUMMARY - echo "ghcr.io/${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY - echo "ghcr.io/${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY - docker manifest push --purge ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} || : - docker manifest create ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} ghcr.io/${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }} ghcr.io/${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} - docker manifest annotate ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} ghcr.io/${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} --os linux --arch arm64 --variant v8 - docker manifest push --purge ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} - echo "Pushed the following PR manifest to GHCR:" >> $GITHUB_STEP_SUMMARY - echo "ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following PR images/tags to GHCR:\n\n" >> $GITHUB_STEP_SUMMARY + echo "\`ghcr.io/${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY + echo "\`ghcr.io/${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY + docker buildx imagetools create -t ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} ghcr.io/${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }} ghcr.io/${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} + printf "\n## Pushed the following PR manifest to GHCR:\n\n" >> $GITHUB_STEP_SUMMARY + echo "\`ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY else docker push ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} - echo "Pushed the following PR image/tag to GHCR:" >> $GITHUB_STEP_SUMMARY - echo "ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following PR image/tag to GHCR:\n\n" >> $GITHUB_STEP_SUMMARY + echo "\`ghcr.io/${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY fi - name: Add GHCR push comment to PR - uses: peter-evans/create-or-update-comment@v4.0.0 + uses: peter-evans/create-or-update-comment@v5.0.0 if: ${{ env.GITHUB_REPO == format('{0}/{1}', github.event.pull_request.base.repo.owner.login, github.event.pull_request.base.repo.name) && env.CR_USER && env.CR_PAT }} with: token: ${{ secrets.CR_PAT }} @@ -194,26 +201,23 @@ jobs: if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.GITHUB_REPO == github.repository && env.DOCKERUSER && env.DOCKERPASS }} run: | if [[ "${MULTI_ARCH,,}" == "true" ]]; then - echo "Pushed the following images/tags to Docker Hub:" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following images/tags to Docker Hub:\n\n" >> $GITHUB_STEP_SUMMARY for i in ${DOCKERHUB_TAGS}; do docker push ${i/:/:amd64-} - echo "${i/:/:amd64-}" >> $GITHUB_STEP_SUMMARY + echo "\`${i/:/:amd64-}\`" >> $GITHUB_STEP_SUMMARY docker push ${i/:/:arm64v8-} - echo "${i/:/:arm64v8-}" >> $GITHUB_STEP_SUMMARY + echo "\`${i/:/:arm64v8-}\`" >> $GITHUB_STEP_SUMMARY done - echo "Pushed the following manifests to Docker Hub:" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following manifests to Docker Hub:\n\n" >> $GITHUB_STEP_SUMMARY for i in ${DOCKERHUB_TAGS}; do - docker manifest push --purge ${i} || : - docker manifest create ${i} ${i/:/:amd64-} ${i/:/:arm64v8-} - docker manifest annotate ${i} ${i/:/:arm64v8-} --os linux --arch arm64 --variant v8 - docker manifest push --purge ${i} - echo "${i}" >> $GITHUB_STEP_SUMMARY + docker buildx imagetools create -t ${i} ${i/:/:amd64-} ${i/:/:arm64v8-} + echo "\`${i}\`" >> $GITHUB_STEP_SUMMARY done else - echo "Pushed the following images/tags to Docker Hub:" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following images/tags to Docker Hub:\n\n" >> $GITHUB_STEP_SUMMARY for i in ${DOCKERHUB_TAGS}; do docker push ${i} - echo "${i}" >> $GITHUB_STEP_SUMMARY + echo "\`${i}\`" >> $GITHUB_STEP_SUMMARY done fi @@ -223,17 +227,14 @@ jobs: if [[ "${MULTI_ARCH,,}" == "true" ]]; then docker push ${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }} docker push ${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} - echo "Pushed the following PR images/tags to Docker Hub:" >> $GITHUB_STEP_SUMMARY - echo "${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY - echo "${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY - docker manifest push --purge ${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} || : - docker manifest create ${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} ${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }} ${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} - docker manifest annotate ${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} ${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} --os linux --arch arm64 --variant v8 - docker manifest push --purge ${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} - echo "Pushed the following PR manifest to Docker Hub:" >> $GITHUB_STEP_SUMMARY - echo "${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following PR images/tags to Docker Hub:\n\n" >> $GITHUB_STEP_SUMMARY + echo "\`${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY + echo "\`${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY + docker buildx imagetools create -t ${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} ${ENDPOINT}:amd64-pull_request_${{ github.event.pull_request.number }} ${ENDPOINT}:arm64v8-pull_request_${{ github.event.pull_request.number }} + printf "\n## Pushed the following PR manifest to Docker Hub:\n\n" >> $GITHUB_STEP_SUMMARY + echo "\`${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY else docker push ${ENDPOINT}:pull_request_${{ github.event.pull_request.number }} - echo "Pushed the following PR image/tag to Docker Hub:" >> $GITHUB_STEP_SUMMARY - echo "${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}" >> $GITHUB_STEP_SUMMARY + printf "\n## Pushed the following PR image/tag to Docker Hub:\n\n" >> $GITHUB_STEP_SUMMARY + echo "\`${ENDPOINT}:pull_request_${{ github.event.pull_request.number }}\`" >> $GITHUB_STEP_SUMMARY fi diff --git a/.github/workflows/init-svc-executable-permissions.yml b/.github/workflows/init-svc-executable-permissions.yml index a4d7f8a..4fe50b9 100644 --- a/.github/workflows/init-svc-executable-permissions.yml +++ b/.github/workflows/init-svc-executable-permissions.yml @@ -6,9 +6,10 @@ jobs: permission_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false - name: Check Permissions run: | WRONG_PERM=$(find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print) diff --git a/.github/workflows/invalid-interaction-helper.yml b/.github/workflows/invalid-interaction-helper.yml index 0586a71..db80092 100644 --- a/.github/workflows/invalid-interaction-helper.yml +++ b/.github/workflows/invalid-interaction-helper.yml @@ -10,7 +10,7 @@ jobs: issues: write steps: - name: Add comment on invalid - uses: peter-evans/create-or-update-comment@v4.0.0 + uses: peter-evans/create-or-update-comment@v5.0.0 with: issue-number: ${{ github.event.issue.number}} body: | diff --git a/.github/workflows/issue-pr-tracker.yml b/.github/workflows/issue-pr-tracker.yml index b6719b1..204ca3c 100644 --- a/.github/workflows/issue-pr-tracker.yml +++ b/.github/workflows/issue-pr-tracker.yml @@ -101,7 +101,7 @@ jobs: run: | echo 'PR [#${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }}) is added to [project](https://github.com/orgs/linuxserver/projects/8) column "PRs Approved"' >> $GITHUB_STEP_SUMMARY - name: Add Comment on Invalid Labeling - uses: peter-evans/create-or-update-comment@v4.0.0 + uses: peter-evans/create-or-update-comment@v5.0.0 if: ${{ github.event_name == 'issues' && github.event.issue.state == 'open' && github.event.label.name == 'invalid' && contains(github.event.issue.labels.*.name, 'invalid') && ! contains(github.event.issue.labels.*.name, 'closed-pr-activity') }} with: issue-number: ${{ github.event.issue.number}} diff --git a/.github/workflows/issues-cron.yml b/.github/workflows/issues-cron.yml index 243b9f5..cc376c3 100644 --- a/.github/workflows/issues-cron.yml +++ b/.github/workflows/issues-cron.yml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/stale@v9.0.0 + - uses: actions/stale@v10.3.0 with: close-issue-label: closed-issue-activity close-pr-label: closed-pr-activity @@ -65,7 +65,7 @@ jobs: - stale steps: - - uses: dessant/lock-threads@v5.0.1 + - uses: dessant/lock-threads@v6.0.2 with: issue-inactive-days: "30" include-any-issue-labels: no-issue-activity @@ -75,3 +75,4 @@ jobs: include-any-pr-labels: no-pr-activity pr-comment: This pull request is locked due to inactivity exclude-any-pr-labels: awaiting-approval,work-in-progress + github-token: ${{ secrets.CR_PAT }}