diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b66ddd4..504acb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,23 +47,23 @@ jobs: # Generate changelog dynamically using the version helper VERSION="${{ steps.version.outputs.VERSION }}" echo "📝 Generating changelog for version $VERSION..." - + # Use the VersionHelper to generate changelog content CHANGELOG_CONTENT=$(bundle exec ruby -e " require_relative 'lib/version_helper' puts VersionHelper.generate_changelog_for_version('$VERSION') ") - + # Save to file to preserve multiline content echo "$CHANGELOG_CONTENT" > changelog_body.txt - + # Set as output for use in release { echo 'BODY<> $GITHUB_OUTPUT - + echo "✅ Generated changelog for version $VERSION" - name: Build and package application diff --git a/README.md b/README.md index a0096fb..bdf4c83 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,22 @@ DEBUG=false # Optional: set to 'true' for debug logging #### Slack Bot Token +You have two options for setting up your Slack app: + +##### Option 1: Create App from Manifest (Recommended) + +1. Go to [Slack API](https://api.slack.com/apps) +2. Click "Create New App" +3. Select "From an app manifest" +4. Choose your workspace +5. Copy the contents of [`docs/app-manifest.json`](docs/app-manifest.json) and paste it into the manifest editor +6. Replace `https://your-domain.com` with your actual domain (e.g., `https://your-app.ngrok.io` for local development) +7. Review and create the app +8. Go to "OAuth & Permissions" and install the app to your workspace +9. Copy the "Bot User OAuth Token" + +##### Option 2: Manual Setup + 1. Go to [Slack API](https://api.slack.com/apps) 2. Create a new app or use an existing one 3. Go to "OAuth & Permissions" @@ -92,8 +108,13 @@ DEBUG=false # Optional: set to 'true' for debug logging **Note**: Even with these scopes, the bot may still need to be added to private channels manually. -5. Install the app to your workspace -6. Copy the "Bot User OAuth Token" +5. Set up slash commands and shortcuts: + - Go to "Slash Commands" and create `/ghcomment` pointing to `https://your-domain.com/ghcomment` + - Go to "Interactivity & Shortcuts" and: + - Enable interactivity with Request URL: `https://your-domain.com/shortcut` + - Add shortcuts as defined in the app manifest +6. Install the app to your workspace +7. Copy the "Bot User OAuth Token" #### GitHub Token @@ -120,12 +141,16 @@ DEBUG=false # Optional: set to 'true' for debug logging 3. Configure your Slack slash command to point to `https://your-ngrok-url.ngrok.io/ghcomment` -### Slack Slash Command Setup +### Slack App Configuration + +If you created your app using the manifest (Option 1 above), your slash commands and shortcuts are already configured. Simply update the URLs to match your deployment domain. + +If you set up your app manually (Option 2), you'll need to configure: -1. In your Slack app configuration, go to "Slash Commands" -2. Create a new command (e.g., `/ghcomment`) -3. Set the Request URL to your application endpoint: `https://your-domain.com/ghcomment` -4. Configure the command to be used in channels and direct messages +1. **Slash Commands**: Create `/ghcomment` pointing to `https://your-domain.com/ghcomment` +2. **Interactivity & Shortcuts**: + - Enable interactivity with Request URL: `https://your-domain.com/shortcut` + - Add message and global shortcuts as defined in [`docs/app-manifest.json`](docs/app-manifest.json) ### Using the Command @@ -183,6 +208,8 @@ docker run -p 3000:3000 --env-file .env slack-github-threads ├── Gemfile # Ruby dependencies ├── Dockerfile # Docker configuration ├── Rakefile # Task definitions and test runner +├── docs/ # Documentation and configuration +│ └── app-manifest.json # Slack app manifest for easy setup ├── lib/ # Application modules │ ├── services/ # Business logic services │ │ ├── slack_service.rb # Slack API interactions diff --git a/docs/app-manifest.json b/docs/app-manifest.json new file mode 100644 index 0000000..a073082 --- /dev/null +++ b/docs/app-manifest.json @@ -0,0 +1,67 @@ +{ + "display_information": { + "name": "GitHub Threads", + "description": "A Slack slash command integration that posts Slack thread conversations as comments to GitHub issues.", + "background_color": "#2c2d30", + "long_description": "This app provides a bridge between Slack and GitHub, allowing you to easily share Slack thread discussions as comments on GitHub issues. When you use the slash command with a GitHub issue URL, it will collect all messages in the current thread and post them as a formatted comment to the specified GitHub issue." + }, + "features": { + "app_home": { + "home_tab_enabled": true, + "messages_tab_enabled": false, + "messages_tab_read_only_enabled": false + }, + "bot_user": { + "display_name": "GitHub Threads", + "always_online": true + }, + "shortcuts": [ + { + "name": "Post thread to GitHub", + "type": "message", + "callback_id": "post_message_to_gh", + "description": "Post the thread content as a comment on a GitHub issue" + }, + { + "name": "Post thread to GitHub", + "type": "global", + "callback_id": "post_to_gh", + "description": "Post the thread content as a comment on a GitHub issue" + } + ], + "slash_commands": [ + { + "command": "/ghcomment", + "url": "https://your-domain.com/ghcomment", + "description": "Post this thread to a GitHub issue", + "usage_hint": "[github issue url]", + "should_escape": false + } + ] + }, + "oauth_config": { + "scopes": { + "bot": [ + "channels:history", + "chat:write", + "commands", + "users:read", + "channels:join", + "channels:read", + "groups:history", + "groups:read", + "im:history", + "mpim:history" + ] + } + }, + "settings": { + "interactivity": { + "is_enabled": true, + "request_url": "https://your-domain.com/shortcut" + }, + "org_deploy_enabled": false, + "socket_mode_enabled": false, + "token_rotation_enabled": false + } +}