|
| 1 | +# Troubleshooting GitHub Actions |
| 2 | + |
| 3 | +This guide helps resolve common issues when setting up and running the SSH Remote Script Executor action. |
| 4 | + |
| 5 | +## GitHub Actions Permission Issues |
| 6 | + |
| 7 | +### Error: "Resource not accessible by integration" |
| 8 | + |
| 9 | +**Problem**: The GitHub Actions workflow fails with permission errors. |
| 10 | + |
| 11 | +**Solution**: This has been fixed in the latest version by: |
| 12 | +1. Adding explicit permissions to the workflow |
| 13 | +2. Using GitHub CLI instead of deprecated actions |
| 14 | +3. Proper token configuration |
| 15 | + |
| 16 | +**What was changed**: |
| 17 | +```yaml |
| 18 | +permissions: |
| 19 | + contents: write |
| 20 | + packages: write |
| 21 | + issues: write |
| 22 | + pull-requests: write |
| 23 | +``` |
| 24 | +
|
| 25 | +### Error: "actions/create-release@v1 is deprecated" |
| 26 | +
|
| 27 | +**Problem**: The old `actions/create-release@v1` action is deprecated and has permission issues. |
| 28 | + |
| 29 | +**Solution**: Updated to use GitHub CLI (`gh`) which is more reliable: |
| 30 | +```yaml |
| 31 | +- name: Create GitHub Release |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | + run: | |
| 35 | + gh release create ${{ steps.version.outputs.version }} \ |
| 36 | + --title "SSH Remote Script Executor ${{ steps.version.outputs.version }}" \ |
| 37 | + --notes-file release_notes.md \ |
| 38 | + --latest |
| 39 | +``` |
| 40 | + |
| 41 | +## Repository Setup Issues |
| 42 | + |
| 43 | +### Repository Must Be Public |
| 44 | + |
| 45 | +**Problem**: GitHub Marketplace requires public repositories. |
| 46 | + |
| 47 | +**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" |
| 52 | + |
| 53 | +### Missing Required Files |
| 54 | + |
| 55 | +**Problem**: Release workflow fails because required files are missing. |
| 56 | + |
| 57 | +**Solution**: Ensure these files exist: |
| 58 | +- `action.yml` (action metadata) |
| 59 | +- `Dockerfile` (container definition) |
| 60 | +- `entrypoint.sh` (executable script) |
| 61 | +- `README.md` (documentation) |
| 62 | + |
| 63 | +Check with: |
| 64 | +```bash |
| 65 | +ls -la action.yml Dockerfile entrypoint.sh README.md |
| 66 | +``` |
| 67 | + |
| 68 | +## Token Permission Issues |
| 69 | + |
| 70 | +### GITHUB_TOKEN Permissions |
| 71 | + |
| 72 | +**Problem**: The default `GITHUB_TOKEN` doesn't have enough permissions. |
| 73 | + |
| 74 | +**Solution**: The workflow now includes explicit permissions: |
| 75 | +```yaml |
| 76 | +permissions: |
| 77 | + contents: write # Create releases and tags |
| 78 | + packages: write # Docker registry access |
| 79 | + issues: write # Create issues if needed |
| 80 | + pull-requests: write # PR management |
| 81 | +``` |
| 82 | + |
| 83 | +### Repository Settings |
| 84 | + |
| 85 | +**Problem**: Repository settings prevent Actions from creating releases. |
| 86 | + |
| 87 | +**Solution**: |
| 88 | +1. Go to Settings → Actions → General |
| 89 | +2. Under "Workflow permissions" select: |
| 90 | + - "Read and write permissions" |
| 91 | + - ✅ "Allow GitHub Actions to create and approve pull requests" |
| 92 | + |
| 93 | +## Docker Build Issues |
| 94 | + |
| 95 | +### Docker Build Failures |
| 96 | + |
| 97 | +**Problem**: The action fails to build the Docker image. |
| 98 | + |
| 99 | +**Solution**: Test locally first: |
| 100 | +```bash |
| 101 | +docker build -t ssh-action-test . |
| 102 | +``` |
| 103 | + |
| 104 | +Common issues: |
| 105 | +- Missing `Dockerfile` |
| 106 | +- Incorrect file permissions on `entrypoint.sh` |
| 107 | +- Package installation failures |
| 108 | + |
| 109 | +Fix permissions: |
| 110 | +```bash |
| 111 | +chmod +x entrypoint.sh |
| 112 | +``` |
| 113 | + |
| 114 | +### Alpine Package Issues |
| 115 | + |
| 116 | +**Problem**: Packages fail to install in Alpine Linux. |
| 117 | + |
| 118 | +**Solution**: Update package names in `Dockerfile`: |
| 119 | +```dockerfile |
| 120 | +RUN apk add --no-cache \ |
| 121 | + openssh-client \ |
| 122 | + sshpass \ |
| 123 | + bash |
| 124 | +``` |
| 125 | + |
| 126 | +## Release Process Issues |
| 127 | + |
| 128 | +### Tag Already Exists |
| 129 | + |
| 130 | +**Problem**: Trying to create a release with an existing tag. |
| 131 | + |
| 132 | +**Solution**: Delete the tag first: |
| 133 | +```bash |
| 134 | +# Delete local tag |
| 135 | +git tag -d v1.0.0 |
| 136 | +
|
| 137 | +# Delete remote tag |
| 138 | +git push origin --delete v1.0.0 |
| 139 | +
|
| 140 | +# Create new tag |
| 141 | +git tag -a v1.0.0 -m "Release v1.0.0" |
| 142 | +git push origin v1.0.0 |
| 143 | +``` |
| 144 | + |
| 145 | +### Release Script Permission Denied |
| 146 | + |
| 147 | +**Problem**: `./scripts/release.sh` fails with permission denied. |
| 148 | + |
| 149 | +**Solution**: Make the script executable: |
| 150 | +```bash |
| 151 | +chmod +x scripts/release.sh |
| 152 | +``` |
| 153 | + |
| 154 | +### Git Configuration Issues |
| 155 | + |
| 156 | +**Problem**: Git operations fail during release. |
| 157 | + |
| 158 | +**Solution**: The workflow automatically configures Git: |
| 159 | +```bash |
| 160 | +git config user.name "GitHub Actions" |
| 161 | +git config user.email "actions@github.com" |
| 162 | +``` |
| 163 | + |
| 164 | +## SSH Action Usage Issues |
| 165 | + |
| 166 | +### SSH Connection Failures |
| 167 | + |
| 168 | +**Problem**: The action fails to connect to remote hosts. |
| 169 | + |
| 170 | +**Common causes**: |
| 171 | +- Incorrect host/IP address |
| 172 | +- Wrong SSH port |
| 173 | +- Firewall blocking connections |
| 174 | +- Invalid credentials |
| 175 | + |
| 176 | +**Solution**: Test SSH connection manually: |
| 177 | +```bash |
| 178 | +ssh -p 22 username@hostname |
| 179 | +``` |
| 180 | + |
| 181 | +### Authentication Issues |
| 182 | + |
| 183 | +**Problem**: SSH authentication fails. |
| 184 | + |
| 185 | +**Solution**: |
| 186 | +1. Verify credentials are correct |
| 187 | +2. Check if password authentication is enabled on the server |
| 188 | +3. Consider using SSH key authentication (future enhancement) |
| 189 | + |
| 190 | +### Script Execution Failures |
| 191 | + |
| 192 | +**Problem**: Scripts fail to execute on remote host. |
| 193 | + |
| 194 | +**Solution**: |
| 195 | +1. Test the script locally first |
| 196 | +2. Check file permissions on remote host |
| 197 | +3. Use absolute paths in scripts |
| 198 | +4. Add proper error handling |
| 199 | + |
| 200 | +## GitHub Marketplace Issues |
| 201 | + |
| 202 | +### Action Not Appearing in Marketplace |
| 203 | + |
| 204 | +**Problem**: Action doesn't show up in GitHub Marketplace. |
| 205 | + |
| 206 | +**Solution**: |
| 207 | +1. Ensure repository is public |
| 208 | +2. Verify `action.yml` has proper branding |
| 209 | +3. Check that a release has been created |
| 210 | +4. Manually publish through repository page |
| 211 | + |
| 212 | +### Marketplace Publication Fails |
| 213 | + |
| 214 | +**Problem**: GitHub rejects marketplace submission. |
| 215 | + |
| 216 | +**Solution**: |
| 217 | +1. Ensure action actually works |
| 218 | +2. Add comprehensive documentation |
| 219 | +3. Include usage examples |
| 220 | +4. Follow GitHub's marketplace guidelines |
| 221 | + |
| 222 | +## Getting Help |
| 223 | + |
| 224 | +If you encounter issues not covered here: |
| 225 | + |
| 226 | +1. **Check workflow logs** in the Actions tab |
| 227 | +2. **Review the error messages** carefully |
| 228 | +3. **Test components individually** (Docker build, SSH connection, etc.) |
| 229 | +4. **Create an issue** in the repository with: |
| 230 | + - Error message |
| 231 | + - Workflow logs |
| 232 | + - Steps to reproduce |
| 233 | + |
| 234 | +## Quick Fixes Checklist |
| 235 | + |
| 236 | +- [ ] Repository is public |
| 237 | +- [ ] All required files exist |
| 238 | +- [ ] Scripts are executable (`chmod +x`) |
| 239 | +- [ ] Workflow permissions are set |
| 240 | +- [ ] Repository Actions settings allow write access |
| 241 | +- [ ] Docker image builds successfully |
| 242 | +- [ ] SSH credentials are valid |
| 243 | +- [ ] Release follows semantic versioning |
| 244 | + |
| 245 | +Following this checklist should resolve most common issues! |
0 commit comments