Skip to content

Commit 47d3fc0

Browse files
authored
Merge pull request #6 from konard/issue-4-e56352679626
Fix: Setup action for production use - Workflow validation and v1 tag preparation
2 parents 809ab61 + dcb09f5 commit 47d3fc0

File tree

1 file changed

+59
-34
lines changed

1 file changed

+59
-34
lines changed

.github/workflows/test-action.yml

Lines changed: 59 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,68 @@
1-
name: Test Action
1+
name: Validate Action
22

3-
# This workflow demonstrates how to use the ProverCoderAI Release Action
4-
# It can be used as a reference for users implementing this action in their repositories
3+
# This workflow validates that the action.yml is properly structured
4+
# Note: This repository contains only the action definition, not a full pnpm monorepo,
5+
# so we cannot run the action itself here. This workflow just validates the metadata.
56

67
on:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
branches:
13+
- main
714
workflow_dispatch:
8-
inputs:
9-
test_mode:
10-
description: 'Run in test mode (skip actual publishing)'
11-
required: false
12-
default: 'true'
13-
14-
permissions:
15-
contents: write
16-
id-token: write
17-
pull-requests: write
18-
packages: write
1915

2016
jobs:
21-
test-release-action:
17+
validate-action:
2218
runs-on: ubuntu-latest
2319
steps:
24-
# Test using the action from the current repository
25-
# In production, this would be: uses: ProverCoderAI/action-release@v1
26-
- name: Test Release Action
27-
uses: ./
28-
with:
29-
ref: ${{ github.sha }}
30-
branch: ${{ github.ref_name }}
31-
package_json_path: packages/app/package.json
32-
pnpm_filter: ./packages/app
33-
bump_type: patch
34-
publish_npm: false # Disabled for testing
35-
publish_github_packages: false # Disabled for testing
36-
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
38-
- name: Display Results
39-
if: always()
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Validate action.yml structure
24+
run: |
25+
echo "Validating action.yml exists and is readable..."
26+
if [ ! -f "action.yml" ]; then
27+
echo "Error: action.yml not found"
28+
exit 1
29+
fi
30+
31+
echo "Checking required fields..."
32+
if ! grep -q "^name:" action.yml; then
33+
echo "Error: 'name' field missing"
34+
exit 1
35+
fi
36+
37+
if ! grep -q "^description:" action.yml; then
38+
echo "Error: 'description' field missing"
39+
exit 1
40+
fi
41+
42+
if ! grep -q "^runs:" action.yml; then
43+
echo "Error: 'runs' field missing"
44+
exit 1
45+
fi
46+
47+
echo "action.yml validation passed!"
48+
49+
- name: Verify composite action type
50+
run: |
51+
echo "Verifying this is a composite action..."
52+
if ! grep -A 1 "^runs:" action.yml | grep -q "using: \"composite\""; then
53+
echo "Error: Not a composite action"
54+
exit 1
55+
fi
56+
echo "Composite action type confirmed!"
57+
58+
- name: Display action info
4059
run: |
41-
echo "Test completed"
42-
echo "This workflow demonstrates the action usage"
43-
echo "In production environments, enable publish_npm and publish_github_packages as needed"
60+
echo "Action Name: $(grep '^name:' action.yml | cut -d'"' -f2)"
61+
echo "Action Description: $(grep '^description:' action.yml | cut -d'"' -f2)"
62+
echo "Validation complete - action is ready to use!"
63+
echo ""
64+
echo "To use this action in your repository:"
65+
echo " - uses: ProverCoderAI/action-release@v1"
66+
echo " with:"
67+
echo " ref: \${{ github.sha }}"
68+
echo " github_token: \${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)