From 6172c4d462edf197a33b9759bac161e0e9cd51da Mon Sep 17 00:00:00 2001 From: "ncmake-updater[bot]" <307247918+ncmake-updater[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 08:01:18 +0000 Subject: [PATCH] ci: update managed CI workflows from upstream Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/.ncmake-workflows.json | 8 ++++---- .github/workflows/branch-cleanup.yml | 3 ++- .github/workflows/workflow-updater.yml | 26 +++++++++++++++++------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/.ncmake-workflows.json b/.github/workflows/.ncmake-workflows.json index 3cdc6a1..f4dd108 100644 --- a/.github/workflows/.ncmake-workflows.json +++ b/.github/workflows/.ncmake-workflows.json @@ -5,8 +5,8 @@ "source": "nextcloud" }, "branch-cleanup.yml": { - "hash": "2b3011daceeab1eb43062f8096d559829f0fc387688298f8977b77deb7975399", - "sha": "5fee38eb16b76634495d19760bb4299ea258fd18", + "hash": "621cfd0244b8b94188ec6c525093eff06b11475d5e866ead7ee11b02b589591a", + "sha": "0a5957bffde5b7b2e4d33f6dae5f75c982ee93e6", "source": "ncmake" }, "lint-info-xml.yml": { @@ -40,8 +40,8 @@ "source": "nextcloud" }, "workflow-updater.yml": { - "hash": "8461d0138be309fe7efb500b7ecf044be88f9138199241f41a7d4ecad37dced0", - "sha": "1adddbae13390821da9dd50c8fbedcb16290da18", + "hash": "51db7ca85627ed5b4641677a577672df724936608152e3a36eef9f90da36e100", + "sha": "d81ef339dca007a84367431100725c64b7de2c74", "source": "ncmake" } } diff --git a/.github/workflows/branch-cleanup.yml b/.github/workflows/branch-cleanup.yml index 5fee38e..0a5957b 100644 --- a/.github/workflows/branch-cleanup.yml +++ b/.github/workflows/branch-cleanup.yml @@ -4,7 +4,8 @@ # ncmake branch cleanup: when a pull request is merged, delete its head branch # if it is still there. This is the workflow-shipped equivalent of the # repository "Automatically delete head branches" setting (see -# doc/DELETE_MERGED_BRANCHES.md): unlike that per-repository toggle it travels +# https://github.com/ernolf/ncmake/wiki/Deleting-merged-branches): unlike that +# per-repository toggle it travels # with the repository through `make workflows-install`, so a repository gets the # cleanup even when no admin has flipped the setting. Running both is harmless: # whichever removes the branch first wins and the other is a quiet no-op. diff --git a/.github/workflows/workflow-updater.yml b/.github/workflows/workflow-updater.yml index 1adddba..d81ef33 100644 --- a/.github/workflows/workflow-updater.yml +++ b/.github/workflows/workflow-updater.yml @@ -12,8 +12,9 @@ # GITHUB_TOKEN may not push workflow files, and it is preferred over a PAT # because the same token both pushes the files and produces verified, signed # commits. Store its credentials as the NCMAKE_UPDATER_CLIENT_ID and -# NCMAKE_UPDATER_PRIVATE_KEY secrets. See doc/AUTOUPDATE_WORKFLOW.md and -# doc/GITHUB_APP.md. +# NCMAKE_UPDATER_PRIVATE_KEY secrets. See +# https://github.com/ernolf/ncmake/wiki/Workflow-updater and +# https://github.com/ernolf/ncmake/wiki/GitHub-App. name: ncmake workflow update @@ -21,7 +22,8 @@ on: schedule: # Daily at 05:30 UTC. GitHub starts scheduled runs on a best-effort basis and # delays them under load, so expect this a few hours late, not on the minute - # (see doc/AUTOUPDATE_WORKFLOW.md). Trigger workflow_dispatch to run without + # (see https://github.com/ernolf/ncmake/wiki/Workflow-updater). Trigger + # workflow_dispatch to run without # waiting for the schedule. - cron: '30 5 * * *' workflow_dispatch: @@ -87,7 +89,8 @@ jobs: # App as the update job, so it always has Contents: write regardless of the # repository's default token permissions. This only ever touches # ncmake/ci/workflow-update, and is unrelated to the repository-wide - # "Automatically delete head branches" setting (see doc/DELETE_MERGED_BRANCHES.md). + # "Automatically delete head branches" setting + # (see https://github.com/ernolf/ncmake/wiki/Deleting-merged-branches). if: >- github.event_name == 'pull_request' && github.event.pull_request.merged == true @@ -101,9 +104,18 @@ jobs: client-id: ${{ secrets.NCMAKE_UPDATER_CLIENT_ID }} private-key: ${{ secrets.NCMAKE_UPDATER_PRIVATE_KEY }} - - name: Delete the merged updater branch + - name: Delete the merged updater branch if it is still there env: GH_TOKEN: ${{ steps.app-token.outputs.token }} run: | - gh api --method DELETE \ - "repos/${{ github.repository }}/git/refs/heads/ncmake/ci/workflow-update" + ref="repos/${{ github.repository }}/git/refs/heads/ncmake/ci/workflow-update" + # The repository's "Automatically delete head branches" setting, or a + # fast-clicking admin, may have removed the branch already. Only delete + # what is still there, and tolerate it vanishing between the check and + # the delete, so a redundant run is a quiet no-op, not a failure. + if gh api "$ref" >/dev/null 2>&1; then + gh api --method DELETE "$ref" \ + || echo "Branch was removed concurrently; nothing to do." + else + echo "Branch already deleted; nothing to do." + fi