Skip to content

Commit 0ffd517

Browse files
committed
add reusable actions
1 parent 30a9dbd commit 0ffd517

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Restore Node Modules Executable Permissions'
2+
description: 'Restores executable permissions for node_modules binaries after artifact download'
3+
4+
inputs:
5+
working-directory:
6+
description: 'Working directory where node_modules is located'
7+
required: false
8+
default: '.'
9+
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Restore executable permissions
14+
shell: bash
15+
working-directory: ${{ inputs.working-directory }}
16+
run: |
17+
echo "🔧 Restoring executable permissions..."
18+
find node_modules/.bin -type f -exec chmod +x {} \; 2>/dev/null || true
19+
find node_modules -type f -name "*.node" -exec chmod +x {} \; 2>/dev/null || true
20+
find node_modules -path "*/bin/*" -type f -exec chmod +x {} \; 2>/dev/null || true
21+
find node_modules -path "*/sdks/*" -type f -exec chmod +x {} \; 2>/dev/null || true
22+
echo "✅ Permissions restored"
23+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'Validate Artifact Compatibility'
2+
description: 'Validates that the artifact was built with compatible Node version and OS'
3+
4+
inputs:
5+
artifact-name:
6+
description: 'The actual artifact name to validate'
7+
required: true
8+
artifact-prefix:
9+
description: 'The expected artifact prefix (e.g., node-modules-eas-update-pr or node-modules-eas-update-base)'
10+
required: true
11+
validation-context:
12+
description: 'Description of what is being validated (e.g., "PR commit", "base branch")'
13+
required: false
14+
default: 'artifact'
15+
16+
runs:
17+
using: 'composite'
18+
steps:
19+
- name: Validate artifact compatibility
20+
shell: bash
21+
run: |
22+
NODE_VERSION=$(node --version | sed 's/v//')
23+
OS_NAME=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
24+
EXPECTED_ARTIFACT="${{ inputs.artifact-prefix }}-node${NODE_VERSION}-${OS_NAME}"
25+
26+
echo "🔍 Validating ${{ inputs.validation-context }} artifact compatibility..."
27+
echo " Expected artifact: $EXPECTED_ARTIFACT"
28+
echo " Actual artifact: ${{ inputs.artifact-name }}"
29+
30+
if [ "$EXPECTED_ARTIFACT" != "${{ inputs.artifact-name }}" ]; then
31+
echo "::error title=Artifact Incompatibility::Node version or OS mismatch detected!"
32+
echo "❌ The node_modules artifact was built with different Node version or OS"
33+
echo " This could cause issues with native node modules"
34+
echo " Expected: $EXPECTED_ARTIFACT"
35+
echo " Actual: ${{ inputs.artifact-name }}"
36+
exit 1
37+
fi
38+
echo "✅ ${{ inputs.validation-context }} artifact compatibility validated"

0 commit comments

Comments
 (0)