From bcdf918f6b28cea6f5b86cdfccfbaf3988e0c8b3 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Fri, 10 Apr 2026 19:20:15 +0200 Subject: [PATCH] fix: accessing local actions Signed-off-by: Emilien Escalle --- .../create-and-merge-pull-request/action.yml | 26 +++++++++++++++++-- actions/create-or-update-comment/action.yml | 26 +++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/actions/create-and-merge-pull-request/action.yml b/actions/create-and-merge-pull-request/action.yml index cef4d60..f29f9c7 100644 --- a/actions/create-and-merge-pull-request/action.yml +++ b/actions/create-and-merge-pull-request/action.yml @@ -32,9 +32,22 @@ inputs: runs: using: "composite" steps: - - uses: ./../local-actions + # FIXME: This is a workaround until this issue is resolved: https://github.com/actions/runner/issues/1348. + - name: Prepare sibling actions + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: - source-path: ${{ github.action_path }}/../.. + script: | + const path = require('node:path'); + + const sourcePath = path.resolve(process.env.GITHUB_ACTION_PATH, '..'); + const destinationPath = path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions'); + + await io.rmRF(destinationPath); + await io.mkdirP(destinationPath); + await io.cp(sourcePath, destinationPath, { + recursive: true, + copySourceDirectory: false, + }); - id: github-actions-bot-user uses: ./../self-actions/get-github-actions-bot-user @@ -132,3 +145,12 @@ runs: echo "::error::Failed to merge pull request after $MAX_ATTEMPTS attempts: $MERGE_OUTPUTS" exit 1 + + - name: Cleanup sibling actions + if: ${{ always() }} + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: | + const path = require('node:path'); + + await io.rmRF(path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions')); diff --git a/actions/create-or-update-comment/action.yml b/actions/create-or-update-comment/action.yml index 670df10..5aa4033 100644 --- a/actions/create-or-update-comment/action.yml +++ b/actions/create-or-update-comment/action.yml @@ -34,9 +34,22 @@ inputs: runs: using: "composite" steps: - - uses: ./../local-actions + # FIXME: This is a workaround until this issue is resolved: https://github.com/actions/runner/issues/1348. + - name: Prepare sibling actions + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: - source-path: ${{ github.action_path }}/../.. + script: | + const path = require('node:path'); + + const sourcePath = path.resolve(process.env.GITHUB_ACTION_PATH, '..'); + const destinationPath = path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions'); + + await io.rmRF(destinationPath); + await io.mkdirP(destinationPath); + await io.cp(sourcePath, destinationPath, { + recursive: true, + copySourceDirectory: false, + }); - id: get-issue-number uses: ./../self-actions/get-issue-number @@ -60,3 +73,12 @@ runs: ${{ inputs.body }} reactions: ${{ inputs.reactions }} token: ${{ inputs.token || github.token }} + + - name: Cleanup sibling actions + if: ${{ always() }} + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: | + const path = require('node:path'); + + await io.rmRF(path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions'));