7171 - ✅ Configurable SSH port (default: 22)
7272 - ✅ Password authentication with sshpass
7373 - ✅ Multi-line script support
74+ - ✅ Environment variables support (comma-separated)
7475 - ✅ Proper error handling and validation
7576 - ✅ Security best practices
7677
8586 script: |
8687 echo "Hello from remote server!"
8788 uptime
89+
90+ # With environment variables
91+ - name: Deploy with environment variables
92+ uses: your-username/ssh-action@${{ steps.version.outputs.version }}
93+ with:
94+ host: ${{ secrets.SERVER_HOST }}
95+ username: ${{ secrets.SERVER_USER }}
96+ password: ${{ secrets.SERVER_PASSWORD }}
97+ envs: 'DEPLOY_ENV=production,APP_VERSION=1.2.3'
98+ script: |
99+ echo "Deploying version $APP_VERSION to $DEPLOY_ENV"
100+ # Your deployment script here
88101 ```
89102
90103 ### Security
@@ -108,23 +121,103 @@ jobs:
108121 --notes-file release_notes.md \
109122 --latest
110123
111- - name : Marketplace Publication Info
124+ - name : Validate Marketplace Requirements
125+ run : |
126+ echo "🔍 Validating GitHub Marketplace requirements..."
127+
128+ # Check if repository is public
129+ REPO_VISIBILITY=$(gh repo view ${{ github.repository }} --json visibility --jq '.visibility')
130+ 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+ fi
135+ echo "✅ Repository is public"
136+
137+ # Check action.yml branding
138+ if grep -q "branding:" action.yml && grep -q "icon:" action.yml && grep -q "color:" action.yml; then
139+ echo "✅ action.yml has proper branding configuration"
140+ else
141+ echo "❌ action.yml missing branding configuration"
142+ exit 1
143+ fi
144+
145+ # Check README exists and has content
146+ if [ -f README.md ] && [ -s README.md ]; then
147+ echo "✅ README.md exists and has content"
148+ else
149+ echo "❌ README.md missing or empty"
150+ exit 1
151+ fi
152+
153+ # Check for usage examples in README
154+ if grep -q "```yaml" README.md; then
155+ echo "✅ README contains usage examples"
156+ else
157+ echo "⚠️ README should include usage examples"
158+ fi
159+
160+ echo "🎯 Marketplace requirements validation complete!"
112161 env :
113162 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
163+
164+ - name : Prepare Marketplace Metadata
165+ run : |
166+ echo "📋 Preparing marketplace metadata..."
167+
168+ # Create marketplace metadata file for reference
169+ cat > marketplace-metadata.json << 'EOF'
170+ {
171+ "name": "SSH Remote Script Executor",
172+ "description": "Execute scripts on remote hosts via SSH with password authentication",
173+ "categories": ["Deployment", "Utilities"],
174+ "tags": ["ssh", "remote", "deployment", "scripts", "automation"],
175+ "suggested_keywords": [
176+ "ssh",
177+ "remote-execution",
178+ "deployment",
179+ "server-management",
180+ "automation",
181+ "devops"
182+ ],
183+ "marketplace_url": "https://github.com/marketplace/actions/ssh-remote-script-executor"
184+ }
185+ EOF
186+
187+ echo "✅ Marketplace metadata prepared"
188+ cat marketplace-metadata.json
189+
190+ - name : Auto-Open Marketplace Publication
114191 run : |
192+ echo "🚀 Opening marketplace publication page..."
193+ echo ""
115194 echo "🎉 Release created successfully!"
116- echo "📦 Your action will be automatically available on GitHub Marketplace "
195+ echo "📦 Version: ${{ steps.version.outputs.version }} "
117196 echo "🔗 Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
118197 echo ""
119- echo "ℹ️ To publish to GitHub Marketplace:"
120- echo " 1. Ensure your repository is public"
121- echo " 2. The action.yml file has proper branding (✅ already configured)"
122- echo " 3. Go to your repository's main page"
123- echo " 4. Click 'Publish this Action to the GitHub Marketplace'"
124- echo " 5. Fill in the marketplace details and submit"
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"
125212 echo ""
126- echo "📊 You can also view the release directly:"
127- gh release view ${{ steps.version.outputs.version }} --web || echo " View at: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }}"
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 }}"
215+
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"
219+ env :
220+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128221
129222 # Job to create/update major version tag (e.g., v1, v2)
130223 update-major-tag :
@@ -169,4 +262,98 @@ jobs:
169262 git push origin ${{ steps.major_version.outputs.major_version }}
170263
171264 echo "✅ Updated major version tag: ${{ steps.major_version.outputs.major_version }}"
172- echo "🎯 Users can now use: uses: ${{ github.repository }}@${{ steps.major_version.outputs.major_version }}"
265+ echo "🎯 Users can now use: uses: ${{ github.repository }}@${{ steps.major_version.outputs.major_version }}"
266+
267+ # Job to create marketplace publication tracking issue
268+ create-marketplace-issue :
269+ runs-on : ubuntu-latest
270+ needs : [release, update-major-tag]
271+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
272+
273+ permissions :
274+ contents : write
275+ issues : write
276+
277+ steps :
278+ - name : Extract version from tag
279+ id : version
280+ run : |
281+ TAG_NAME=${GITHUB_REF#refs/tags/}
282+ echo "version=$TAG_NAME" >> $GITHUB_OUTPUT
283+ echo "version_number=${TAG_NAME#v}" >> $GITHUB_OUTPUT
284+
285+ - name : Create Marketplace Publication Issue
286+ env :
287+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
288+ run : |
289+ # Check if an issue already exists for this release
290+ EXISTING_ISSUE=$(gh issue list --repo ${{ github.repository }} --state open --search "Publish ${{ steps.version.outputs.version }} to GitHub Marketplace" --json number --jq '.[0].number' || echo "")
291+
292+ if [ -n "$EXISTING_ISSUE" ] && [ "$EXISTING_ISSUE" != "null" ]; then
293+ echo "📝 Issue already exists for this release: #$EXISTING_ISSUE"
294+ exit 0
295+ fi
296+
297+ # Create the issue
298+ gh issue create \
299+ --repo ${{ github.repository }} \
300+ --title "🏪 Publish ${{ steps.version.outputs.version }} to GitHub Marketplace" \
301+ --assignee ${{ github.actor }} \
302+ --label "marketplace,release" \
303+ --body "## 🚀 Release ${{ steps.version.outputs.version }} Ready for Marketplace Publication
304+
305+ ### ✅ Pre-publication Checklist
306+ - [x] Release created successfully
307+ - [x] Major version tag updated
308+ - [x] All marketplace requirements validated
309+ - [x] Docker image builds successfully
310+ - [x] Action metadata configured
311+ - [ ] **Marketplace publication completed**
312+
313+ ### 🏪 Marketplace Publication Steps
314+
315+ 1. **Navigate to Repository**
316+ - Go to: https://github.com/${{ github.repository }}
317+ - Look for the \"Publish this Action to the GitHub Marketplace\" banner
318+
319+ 2. **Click Publication Banner**
320+ - The banner should appear at the top of the repository page
321+ - If not visible, go to the Releases tab and click \"Publish to Marketplace\"
322+
323+ 3. **Fill Marketplace Form**
324+ - **Name**: \`SSH Remote Script Executor\`
325+ - **Description**: \`Execute scripts on remote hosts via SSH with password authentication\`
326+ - **Categories**: \`Deployment\`, \`Utilities\`
327+ - **Tags**: \`ssh\`, \`remote\`, \`deployment\`, \`scripts\`, \`automation\`
328+
329+ 4. **Submit for Review**
330+ - Review the information and submit
331+ - GitHub will review the action before publishing
332+
333+ ### 📋 Marketplace Metadata
334+
335+ \`\`\`json
336+ {
337+ \"name\": \"SSH Remote Script Executor\",
338+ \"description\": \"Execute scripts on remote hosts via SSH with password authentication\",
339+ \"categories\": [\"Deployment\", \"Utilities\"],
340+ \"tags\": [\"ssh\", \"remote\", \"deployment\", \"scripts\", \"automation\"],
341+ \"version\": \"${{ steps.version.outputs.version }}\"
342+ }
343+ \`\`\`
344+
345+ ### 🔗 Quick Links
346+ - [Release Page](https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.version }})
347+ - [Repository](https://github.com/${{ github.repository }})
348+ - [Action Documentation](https://github.com/${{ github.repository }}/blob/main/README.md)
349+
350+ ### 📝 Notes
351+ - This issue will be automatically closed when the marketplace publication is complete
352+ - The action will be available at: \`uses: ${{ github.repository }}@${{ steps.version.outputs.version }}\`
353+ - Major version tag available: \`uses: ${{ github.repository }}@v$(echo ${{ steps.version.outputs.version }} | cut -d. -f1 | sed 's/v//')\`
354+
355+ **Assigned to**: @${{ github.actor }}
356+ **Release**: ${{ steps.version.outputs.version }}
357+ **Status**: Ready for marketplace publication"
358+
359+ echo "📝 Created marketplace publication tracking issue"
0 commit comments