Skip to content

Commit 03a5a2a

Browse files
committed
fix: accessing local actions
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent a236f01 commit 03a5a2a

2 files changed

Lines changed: 48 additions & 4 deletions

File tree

actions/create-and-merge-pull-request/action.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,22 @@ inputs:
3232
runs:
3333
using: "composite"
3434
steps:
35-
- uses: ./../local-actions
35+
# FIXME: This is a workaround until this issue is resolved: https://github.com/actions/runner/issues/1348.
36+
- name: Prepare sibling actions
37+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
3638
with:
37-
source-path: ${{ github.action_path }}/../..
39+
script: |
40+
const path = require('node:path');
41+
42+
const sourcePath = path.resolve(process.env.GITHUB_ACTION_PATH, '..');
43+
const destinationPath = path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions');
44+
45+
await io.rmRF(destinationPath);
46+
await io.mkdirP(destinationPath);
47+
await io.cp(sourcePath, destinationPath, {
48+
recursive: true,
49+
copySourceDirectory: false,
50+
});
3851
3952
- id: github-actions-bot-user
4053
uses: ./../self-actions/get-github-actions-bot-user
@@ -132,3 +145,12 @@ runs:
132145
133146
echo "::error::Failed to merge pull request after $MAX_ATTEMPTS attempts: $MERGE_OUTPUTS"
134147
exit 1
148+
149+
- name: Cleanup sibling actions
150+
if: ${{ always() }}
151+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
152+
with:
153+
script: |
154+
const path = require('node:path');
155+
156+
await io.rmRF(path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions'));

actions/create-or-update-comment/action.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,22 @@ inputs:
3434
runs:
3535
using: "composite"
3636
steps:
37-
- uses: ./../local-actions
37+
# FIXME: This is a workaround until this issue is resolved: https://github.com/actions/runner/issues/1348.
38+
- name: Prepare sibling actions
39+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
3840
with:
39-
source-path: ${{ github.action_path }}/../..
41+
script: |
42+
const path = require('node:path');
43+
44+
const sourcePath = path.resolve(process.env.GITHUB_ACTION_PATH, '..');
45+
const destinationPath = path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions');
46+
47+
await io.rmRF(destinationPath);
48+
await io.mkdirP(destinationPath);
49+
await io.cp(sourcePath, destinationPath, {
50+
recursive: true,
51+
copySourceDirectory: false,
52+
});
4053
4154
- id: get-issue-number
4255
uses: ./../self-actions/get-issue-number
@@ -60,3 +73,12 @@ runs:
6073
${{ inputs.body }}
6174
reactions: ${{ inputs.reactions }}
6275
token: ${{ inputs.token || github.token }}
76+
77+
- name: Cleanup sibling actions
78+
if: ${{ always() }}
79+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
80+
with:
81+
script: |
82+
const path = require('node:path');
83+
84+
await io.rmRF(path.resolve(process.env.GITHUB_WORKSPACE, '..', 'self-actions'));

0 commit comments

Comments
 (0)