-
Notifications
You must be signed in to change notification settings - Fork 181
feat: support slack cli commands with composite action inputs #560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ae50e2e
165d9f6
2d8c996
077f882
35b8102
5d5197b
613ab73
47ed37c
4e7d5d3
f50140b
b48e5cf
32371dd
059f8f3
eaed8db
65f25ff
4b307de
2d3baa1
c6baa4b
8607d1d
d343286
e2bce82
fc6915d
6f7dc50
ddae541
4a0cf78
d8247ad
3698dd9
8a37599
86c95e5
809cf5c
c73fa17
069243d
5d9cb89
ae9124d
4aab456
2d9b061
03b6946
638743f
671d51b
1003081
22fc69b
cba9656
4500857
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| { | ||
| "experiments": ["bolt"], | ||
| "manifest": { | ||
| "source": "local" | ||
| }, | ||
| "project_id": "c4805b41-d1ce-4ea0-b297-ed2f8c64c267" | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -12,7 +12,7 @@ on: | |||
|
|
||||
| jobs: | ||||
| integration: | ||||
| name: Run integration tests | ||||
| name: Run API tests | ||||
| runs-on: ubuntu-latest | ||||
| environment: staging | ||||
| permissions: | ||||
|
|
@@ -68,7 +68,7 @@ jobs: | |||
| env: | ||||
| INPUT_REF: ${{ inputs.ref }} | ||||
|
|
||||
| - name: "integration(wfb): send a payload to workflow builder via webhook trigger" | ||||
| - name: "test(wfb): send a payload to workflow builder via webhook trigger" | ||||
| id: wfb | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -82,12 +82,12 @@ jobs: | |||
| repo_name: ${{ github.event.repository.full_name }} | ||||
| status: ${{ job.status }} | ||||
|
|
||||
| - name: "integration(wfb): confirm a payload was sent" | ||||
| - name: "test(wfb): confirm a payload was sent" | ||||
| run: test -n "$WFB_OUTPUT_TIME" | ||||
| env: | ||||
| WFB_OUTPUT_TIME: ${{ steps.wfb.outputs.time }} | ||||
|
|
||||
| - name: "integration(botToken): post a message to channel" | ||||
| - name: "test(api): post a message to channel" | ||||
| id: message | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -98,12 +98,12 @@ jobs: | |||
| channel: ${{ secrets.SLACK_CHANNEL_ID }} | ||||
| text: ":checkered_flag: Action happens at <https://github.com/${{ github.repository }}>" | ||||
|
|
||||
| - name: "integration(method): confirm a message was posted" | ||||
| - name: "test(api): confirm a message was posted" | ||||
| run: test -n "$MESSAGE_OUTPUT_TS" | ||||
| env: | ||||
| MESSAGE_OUTPUT_TS: ${{ steps.message.outputs.ts }} | ||||
|
|
||||
| - name: "integration(method): post a message with blocks" | ||||
| - name: "test(api): post a message with blocks" | ||||
| id: blocks | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -120,12 +120,12 @@ jobs: | |||
| short: true | ||||
| value: "Processing" | ||||
|
|
||||
| - name: "integration(method): confirm the blocks were posted" | ||||
| - name: "test(api): confirm the blocks were posted" | ||||
| run: test -n "$BLOCKS_OUTPUT_TS" | ||||
| env: | ||||
| BLOCKS_OUTPUT_TS: ${{ steps.blocks.outputs.ts }} | ||||
|
|
||||
| - name: "integration(method): post a threaded message" | ||||
| - name: "test(api): post a threaded message" | ||||
| id: timer | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -137,15 +137,15 @@ jobs: | |||
| text: "Started at `${{ steps.blocks.outputs.time }}`" | ||||
| thread_ts: "${{ steps.blocks.outputs.ts }}" | ||||
|
|
||||
| - name: "integration(incoming): confirm the thread started" | ||||
| - name: "test(api): confirm the thread started" | ||||
| run: test -n "$TIMER_OUTPUT_TIME" | ||||
| env: | ||||
| TIMER_OUTPUT_TIME: ${{ steps.timer.outputs.time }} | ||||
|
|
||||
| - name: "integration(method): wait to mock event processing" | ||||
| - name: "test(api): wait to mock event processing" | ||||
| run: sleep 3 | ||||
|
|
||||
| - name: "integration(method): update the original message" | ||||
| - name: "test(api): update the original message" | ||||
| id: finished | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -163,7 +163,7 @@ jobs: | |||
| short: true | ||||
| value: "Completed" | ||||
|
|
||||
| - name: "integration(method): post another threaded message" | ||||
| - name: "test(api): post another threaded message" | ||||
| id: done | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -175,7 +175,7 @@ jobs: | |||
| text: "Finished at `${{ steps.finished.outputs.time }}`" | ||||
| thread_ts: "${{ steps.timer.outputs.thread_ts }}" | ||||
|
|
||||
| - name: "integration(method): post a file into a channel" | ||||
| - name: "test(api): post a file into a channel" | ||||
| id: file | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -188,7 +188,7 @@ jobs: | |||
| file: .github/workflows/integration.yml | ||||
| filename: integration.yml | ||||
|
|
||||
| - name: "integration(method): react to the completed update message" | ||||
| - name: "test(api): react to the completed update message" | ||||
| uses: ./ | ||||
| with: | ||||
| errors: true | ||||
|
|
@@ -199,38 +199,38 @@ jobs: | |||
| timestamp: ${{ steps.blocks.outputs.ts }} | ||||
| name: "tada" | ||||
|
|
||||
| - name: "integration(method): confirm the thread ended" | ||||
| - name: "test(api): confirm the thread ended" | ||||
| run: test -n "$DONE_OUTPUT_TIME" | ||||
| env: | ||||
| DONE_OUTPUT_TIME: ${{ steps.done.outputs.time }} | ||||
|
|
||||
| - name: "integration(incoming): post a message via incoming webhook" | ||||
| - name: "test(incoming): post a message via incoming webhook" | ||||
| id: incoming | ||||
| uses: ./ | ||||
| with: | ||||
| errors: true | ||||
| webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK }} | ||||
| webhook-type: incoming-webhook | ||||
| payload: | | ||||
| text: "Incoming webhook test for slack send" | ||||
| text: "Incoming webhook test for the Slack GitHub Action" | ||||
| blocks: | ||||
| - type: section | ||||
| text: | ||||
| type: plain_text | ||||
| text: ":link: A message was received via incoming webhook" | ||||
| emoji: true | ||||
|
|
||||
| - name: "integration(incoming): confirm a webhook was posted" | ||||
| - name: "test(incoming): confirm a webhook was posted" | ||||
| run: test -n "$INCOMING_WEBHOOK_OUTPUT_TIME" | ||||
| env: | ||||
| INCOMING_WEBHOOK_OUTPUT_TIME: ${{ steps.incoming.outputs.time }} | ||||
|
|
||||
| - name: "integration(incoming): reveal contents of the github payload" | ||||
| - name: "test(incoming): reveal contents of the github payload" | ||||
| run: echo "$JSON" | ||||
| env: | ||||
| JSON: ${{ toJSON(github) }} | ||||
|
|
||||
| - name: "integration(incoming): post a message via payload file" | ||||
| - name: "test(incoming): post a message via payload file" | ||||
| id: payload_file | ||||
| uses: ./ | ||||
| with: | ||||
|
|
@@ -243,15 +243,81 @@ jobs: | |||
| JOB_STATUS: ${{ job.status }} | ||||
| ATTACHMENT_COLOR: ${{ (job.status == 'success' && 'good') || (job.status == 'failure' && 'danger') || 'warning' }} | ||||
|
|
||||
| - name: "integration(incoming): confirm a payload file was posted" | ||||
| - name: "test(incoming): confirm a payload file was posted" | ||||
| run: test -n "$PAYLOAD_FILE_OUTPUT_TIME" | ||||
| env: | ||||
| PAYLOAD_FILE_OUTPUT_TIME: ${{ steps.payload_file.outputs.time }} | ||||
|
|
||||
| - name: "chore(health): check up on recent changes to the health score" | ||||
| uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1 | ||||
| cli: | ||||
| name: Run CLI tests | ||||
| runs-on: ${{ matrix.os }} | ||||
| environment: staging | ||||
| strategy: | ||||
| fail-fast: false | ||||
| matrix: | ||||
| os: | ||||
| - ubuntu-latest | ||||
| - macos-latest | ||||
| - windows-latest | ||||
|
Comment on lines
+259
to
+261
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice 💯 |
||||
| permissions: | ||||
| contents: read | ||||
| steps: | ||||
| - name: "build: checkout the latest changes" | ||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||
| with: | ||||
| persist-credentials: false | ||||
| ref: ${{ inputs.ref || github.event.pull_request.head.sha || github.sha }} | ||||
|
|
||||
| - name: "test(cli): run a slack cli version check" | ||||
| id: version | ||||
| uses: ./cli | ||||
| with: | ||||
| command: "version" | ||||
| version: "3.14.0" | ||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🧪 note: We pin this version until the next release so that Windows tests pass. A follow up PR is available for after this becomes the 🗣️ ramble: That PR demonstrates failing installation on Windows, but also that the |
||||
|
|
||||
| - name: "test(cli): confirm the version check outputs" | ||||
| shell: bash | ||||
| run: | | ||||
| set -ex | ||||
| [ "$CLI_OK" = "true" ] | ||||
| echo "$CLI_TIME" | grep -qE '^[0-9]+$' | ||||
| [ -n "$CLI_RESPONSE" ] | ||||
| env: | ||||
| CLI_OK: ${{ steps.version.outputs.ok }} | ||||
| CLI_RESPONSE: ${{ steps.version.outputs.response }} | ||||
| CLI_TIME: ${{ steps.version.outputs.time }} | ||||
|
|
||||
| - name: "test(cli): run an unknown command" | ||||
| id: unknown | ||||
| continue-on-error: true | ||||
| uses: ./cli | ||||
| with: | ||||
| command: "off" | ||||
|
|
||||
| - name: "test(cli): confirm the unknown command outputs" | ||||
| shell: bash | ||||
| run: | | ||||
| set -ex | ||||
| [ "$CLI_OK" = "false" ] | ||||
| echo "$CLI_TIME" | grep -qE '^[0-9]+$' | ||||
| [ -n "$CLI_RESPONSE" ] | ||||
| env: | ||||
| CLI_OK: ${{ steps.unknown.outputs.ok }} | ||||
| CLI_RESPONSE: ${{ steps.unknown.outputs.response }} | ||||
| CLI_TIME: ${{ steps.unknown.outputs.time }} | ||||
|
|
||||
| - name: "chore: configure the actioneering application" | ||||
| shell: bash | ||||
| run: mv .github/resources/.slack .slack | ||||
|
|
||||
| - name: "test(cli): validate the app manifest" | ||||
| uses: ./cli | ||||
| with: | ||||
| command: "manifest" | ||||
| token: ${{ secrets.SLACK_SERVICE_TOKEN }} | ||||
|
|
||||
| - name: "test(cli): deploy the app" | ||||
| uses: ./cli | ||||
| with: | ||||
| codecov_token: ${{ secrets.CODECOV_API_TOKEN }} | ||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||
| extension: js | ||||
| include: src | ||||
|
Comment on lines
-254
to
-257
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔏 note: This is also removed in #559 but status checks are being reported as error for forked branches at this time. |
||||
| command: "deploy --app ${{ vars.SLACK_APP_ID }} --hide-triggers --force" | ||||
| token: ${{ secrets.SLACK_SERVICE_TOKEN }} | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,9 @@ jobs: | |
| uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1 | ||
| with: | ||
| template: javascript-action | ||
| include: | | ||
| dist/**/* | ||
| cli/**/* | ||
|
Comment on lines
+41
to
+43
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📠 note: An example build shows both directories and adjacent files exist and work as expected! 📦 https://github.com/zimeg/slack-github-action/tree/v2.2.0-rc.1 |
||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: "Slack: Send to Slack" | ||
| name: "Slack GitHub Action" | ||
| author: "slackapi" | ||
| description: "Send data to Slack to start a Slack workflow in Workflow Builder, call a Slack API method, or post a message into a channel" | ||
|
Comment on lines
+1
to
3
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📣 note: We're renaming this action to match the project name and be more generic of the techniques available. This updates the marketplace page from what I understand. The link might change but I don't believe that must be static. Heads up though!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📚 question: Should we update the 💡 thought: I didn't change it since the techniques served with these inputs are noted here while the CLI is included in separate configurations. Earlier discussion more with @WilliamBergamin hint that we might deprecate the top-level action for: - slackapi/slack-github-action/api@v3
- slackapi/slack-github-action/bot@v3
- slackapi/slack-github-action/cli@v3
- slackapi/slack-github-action/wfb@v3But we don't have immediate plans for this. The "bot" technique also might not be true - it's meant for sending messages with incoming webhooks - but the patterns seem best for separate inputs more! I do think we can still package this action using this same |
||
| inputs: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔭 thought: This might be a limitation of the CLI at the moment. I think patterns exist elsewhere toward this, but I'm curious if an option in this action makes more sense...