Skip to content

Commit 6ca45cf

Browse files
committed
Added support for private repos
1 parent 7b4b1a9 commit 6ca45cf

File tree

4 files changed

+336
-37
lines changed

4 files changed

+336
-37
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ permissions:
1414
jobs:
1515
release:
1616
runs-on: ubuntu-latest
17+
outputs:
18+
marketplace-ready: ${{ steps.marketplace-check.outputs.marketplace-ready }}
1719

1820
steps:
1921
- name: Checkout repository
@@ -122,32 +124,41 @@ jobs:
122124
--latest
123125
124126
- name: Validate Marketplace Requirements
127+
id: marketplace-check
125128
run: |
126129
echo "🔍 Validating GitHub Marketplace requirements..."
127130
128131
# Check if repository is public
129132
REPO_VISIBILITY=$(gh repo view ${{ github.repository }} --json visibility --jq '.visibility')
130133
if [ "$REPO_VISIBILITY" != "public" ]; then
131-
echo "❌ Repository must be public for marketplace publication"
132-
echo " Go to Settings → Change repository visibility → Make public"
133-
exit 1
134+
echo "⚠️ Repository is private - marketplace publication not possible"
135+
echo "📝 To publish to GitHub Marketplace:"
136+
echo " 1. Go to Settings → General → Change repository visibility"
137+
echo " 2. Click 'Change visibility' → 'Make public'"
138+
echo " 3. Re-run the release workflow after making it public"
139+
echo ""
140+
echo "🔄 Continuing with private repository release..."
141+
MARKETPLACE_READY=false
142+
else
143+
echo "✅ Repository is public"
144+
MARKETPLACE_READY=true
134145
fi
135-
echo "✅ Repository is public"
136146
137147
# Check action.yml branding
138148
if grep -q "branding:" action.yml && grep -q "icon:" action.yml && grep -q "color:" action.yml; then
139149
echo "✅ action.yml has proper branding configuration"
140150
else
141-
echo "❌ action.yml missing branding configuration"
142-
exit 1
151+
echo "⚠️ action.yml missing branding configuration"
152+
echo " Add branding section to action.yml for marketplace publication"
153+
MARKETPLACE_READY=false
143154
fi
144155
145156
# Check README exists and has content
146157
if [ -f README.md ] && [ -s README.md ]; then
147158
echo "✅ README.md exists and has content"
148159
else
149-
echo " README.md missing or empty"
150-
exit 1
160+
echo "⚠️ README.md missing or empty"
161+
MARKETPLACE_READY=false
151162
fi
152163
153164
# Check for usage examples in README
@@ -157,7 +168,16 @@ jobs:
157168
echo "⚠️ README should include usage examples"
158169
fi
159170
160-
echo "🎯 Marketplace requirements validation complete!"
171+
# Set marketplace readiness status
172+
if [ "$MARKETPLACE_READY" = "true" ]; then
173+
echo "🎯 Marketplace requirements validation complete - Ready for publication!"
174+
echo "MARKETPLACE_READY=true" >> $GITHUB_ENV
175+
echo "marketplace-ready=true" >> $GITHUB_OUTPUT
176+
else
177+
echo "⚠️ Marketplace requirements not fully met - Release will continue without marketplace publication"
178+
echo "MARKETPLACE_READY=false" >> $GITHUB_ENV
179+
echo "marketplace-ready=false" >> $GITHUB_OUTPUT
180+
fi
161181
env:
162182
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163183

@@ -187,35 +207,48 @@ jobs:
187207
echo "✅ Marketplace metadata prepared"
188208
cat marketplace-metadata.json
189209
190-
- name: Auto-Open Marketplace Publication
210+
- name: Marketplace Publication Info
191211
run: |
192-
echo "🚀 Opening marketplace publication page..."
193-
echo ""
194212
echo "🎉 Release created successfully!"
195213
echo "📦 Version: ${{ steps.version.outputs.version }}"
196214
echo "🔗 Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
197215
echo ""
198-
echo "🏪 MARKETPLACE PUBLICATION:"
199-
echo " 📋 All requirements validated ✅"
200-
echo " 🔗 Publication URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
201-
echo ""
202-
echo "📝 To complete marketplace publication:"
203-
echo " 1. 🌐 Go to: https://github.com/${{ github.repository }}"
204-
echo " 2. 📦 Look for 'Publish this Action to the GitHub Marketplace' banner"
205-
echo " 3. 🖱️ Click the banner or go to the Releases tab"
206-
echo " 4. ✏️ Fill in the marketplace form with suggested details:"
207-
echo " - Name: SSH Remote Script Executor"
208-
echo " - Description: Execute scripts on remote hosts via SSH"
209-
echo " - Categories: Deployment, Utilities"
210-
echo " - Tags: ssh, remote, deployment, scripts, automation"
211-
echo " 5. 📤 Submit for publication"
212-
echo ""
213-
echo "🎯 The action will be reviewed and published to GitHub Marketplace!"
214-
echo "📊 View release: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
215216
216-
# Try to open the marketplace page (this works in some environments)
217-
echo "🔗 Attempting to open marketplace publication page..."
218-
gh repo view ${{ github.repository }} --web || echo " Manual navigation required"
217+
if [ "$MARKETPLACE_READY" = "true" ]; then
218+
echo "🏪 MARKETPLACE PUBLICATION:"
219+
echo " 📋 All requirements validated ✅"
220+
echo " 🔗 Publication URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
221+
echo ""
222+
echo "📝 To complete marketplace publication:"
223+
echo " 1. 🌐 Go to: https://github.com/${{ github.repository }}"
224+
echo " 2. 📦 Look for 'Publish this Action to the GitHub Marketplace' banner"
225+
echo " 3. 🖱️ Click the banner or go to the Releases tab"
226+
echo " 4. ✏️ Fill in the marketplace form with suggested details:"
227+
echo " - Name: SSH Remote Script Executor"
228+
echo " - Description: Execute scripts on remote hosts via SSH"
229+
echo " - Categories: Deployment, Utilities"
230+
echo " - Tags: ssh, remote, deployment, scripts, automation"
231+
echo " 5. 📤 Submit for publication"
232+
echo ""
233+
echo "🎯 The action will be reviewed and published to GitHub Marketplace!"
234+
235+
# Try to open the marketplace page (this works in some environments)
236+
echo "🔗 Attempting to open marketplace publication page..."
237+
gh repo view ${{ github.repository }} --web || echo " Manual navigation required"
238+
else
239+
echo "⚠️ MARKETPLACE PUBLICATION NOT AVAILABLE:"
240+
echo " 📋 Repository requirements not met"
241+
echo ""
242+
echo "📝 To enable marketplace publication:"
243+
echo " 1. 🌐 Make repository public: Settings → Change repository visibility → Make public"
244+
echo " 2. ✅ Ensure action.yml has branding configuration"
245+
echo " 3. 📖 Add comprehensive README with usage examples"
246+
echo " 4. 🔄 Create a new release after meeting requirements"
247+
echo ""
248+
echo "🎯 Release completed successfully (private repository)"
249+
fi
250+
251+
echo "📊 View release: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
219252
env:
220253
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
221254

@@ -268,7 +301,7 @@ jobs:
268301
create-marketplace-issue:
269302
runs-on: ubuntu-latest
270303
needs: [release, update-major-tag]
271-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
304+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && needs.release.outputs.marketplace-ready == 'true'
272305

273306
permissions:
274307
contents: write

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,39 @@ The action will fail if:
193193
- Use `sudo` in your script if elevated privileges are required
194194
- Verify file and directory permissions
195195

196+
## Repository Setup
197+
198+
### Quick Setup Script
199+
200+
Use the interactive setup script to configure your repository:
201+
202+
```bash
203+
./scripts/setup-repository.sh
204+
```
205+
206+
This script helps you:
207+
- ✅ Check repository status
208+
- ✅ Make repository public (for marketplace)
209+
- ✅ Validate marketplace requirements
210+
- ✅ Create releases
211+
- ✅ Get setup instructions
212+
213+
### Repository Visibility Options
214+
215+
#### **Public Repository (Marketplace)**
216+
- ✅ Can be published to GitHub Marketplace
217+
- ✅ Discoverable by the community
218+
- ✅ Available for public use
219+
- ⚠️ Code is visible to everyone
220+
221+
#### **Private Repository (Internal Use)**
222+
- ✅ Works perfectly for private use
223+
- ✅ Share with collaborators
224+
- ✅ All action features available
225+
- ❌ Cannot publish to marketplace
226+
227+
Choose the option that best fits your needs!
228+
196229
## Contributing
197230

198231
Feel free to submit issues and enhancement requests!

TROUBLESHOOTING.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,21 @@ permissions:
4545
**Problem**: GitHub Marketplace requires public repositories.
4646

4747
**Solution**:
48-
1. Go to your repository Settings
49-
2. Scroll down to "Danger Zone"
50-
3. Click "Change repository visibility"
51-
4. Select "Make public"
48+
1. **Quick Setup**: Run the setup script:
49+
```bash
50+
./scripts/setup-repository.sh
51+
```
52+
Choose option 1 to make repository public
53+
54+
2. **Manual Method**:
55+
- Go to your repository Settings
56+
- Scroll down to "Danger Zone"
57+
- Click "Change repository visibility"
58+
- Select "Make public"
59+
60+
3. **Alternative**: Keep repository private and skip marketplace publication
61+
- The action will still work for private use
62+
- You can publish later by making it public
5263

5364
### Missing Required Files
5465

0 commit comments

Comments
 (0)